Fixup for mistake in earlier commit

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39374 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-02-15 11:07:44 +00:00
parent 09f15d2b8d
commit 44165e9bcc
2 changed files with 19 additions and 16 deletions

View file

@ -573,25 +573,28 @@ static void exitedThread(void *thread)
{
if (thread != defaultThread)
{
CREATE_AUTORELEASE_POOL(arp);
NSValue *ref;
RETAIN((NSThread*)thread);
ref = NSValueCreateFromPthread(pthread_self());
_willLateUnregisterThread(ref, (NSThread*)thread);
NS_DURING
{
unregisterActiveThread((NSThread*)thread);
}
NS_HANDLER
{
DESTROY(arp);
_didLateUnregisterCurrentThread(ref);
DESTROY(ref);
RELEASE((NSThread*)thread);
}
NS_ENDHANDLER
DESTROY(arp);
{
CREATE_AUTORELEASE_POOL(arp);
NS_DURING
{
unregisterActiveThread((NSThread*)thread);
}
NS_HANDLER
{
DESTROY(arp);
_didLateUnregisterCurrentThread(ref);
DESTROY(ref);
RELEASE((NSThread*)thread);
}
NS_ENDHANDLER
DESTROY(arp);
}
/* At this point threre shouldn't be any autoreleased objects lingering
* around anymore. So we may remove the thread from the lookup table.