Fix leaked objects on NSThread dealloc

This commit is contained in:
Airy ANDRE 2012-06-08 15:55:56 +02:00
parent ad5724750e
commit 86df8596fe

View File

@ -80,7 +80,11 @@ static void *nsThreadStartThread(void* t)
[thread main];
[thread setExecuting:NO];
[thread setFinished:YES];
// We need a pool here in case release triggers some autoreleased object allocations
// so they won't stay in limbo
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[thread release];
[pool release];
NSSelectSetShutdownForCurrentThread();
NSPlatformSetCurrentThread(nil);
return 0;