mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2025-02-22 04:53:26 +00:00
Fix leaked objects on NSThread dealloc
This commit is contained in:
parent
ad5724750e
commit
86df8596fe
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user