From 4970d3c02339f1de3823a012270e9a0543d2559f Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 14 Jul 1999 17:16:56 +0000 Subject: [PATCH] Tidy git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4588 72102866-910b-0410-8b05-ffd578937521 --- Source/NSThread.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/NSThread.m b/Source/NSThread.m index d38a9165c..9a1535381 100644 --- a/Source/NSThread.m +++ b/Source/NSThread.m @@ -69,11 +69,13 @@ - (void) sendThreadMethod { /* - * We are running in the new thread - so an autorelease puts us in the - * pool for the thread. If the thread object calls [NSThread exit] the - * pool will be released, otherwise, we call it ourself. + * We are running in the new thread - so we store ourself in the thread + * dictionary and release ourself - thus, when the thread exits, we will + * be deallocated cleanly. */ - AUTORELEASE(self); + [[[NSThread currentThread] threadDictionary] setObject: self + forKey: @"GSThreadLauncher"]; + RELEASE(self); [target performSelector: sel withObject: arg]; [NSThread exit]; }