Catch autoreleased objects during thread exit.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22333 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2006-01-19 06:15:27 +00:00
parent 909f32bf87
commit 7a186a7782
4 changed files with 29 additions and 5 deletions

View file

@ -703,7 +703,10 @@ gnustep_base_thread_callback(void)
DESTROY(_thread_dictionary);
DESTROY(_target);
DESTROY(_arg);
[NSAutoreleasePool _endThread: self];
if (_autorelease_vars.pool_cache != 0)
{
[NSAutoreleasePool _endThread: self];
}
if (_thread_dictionary != nil)
{
@ -711,11 +714,17 @@ gnustep_base_thread_callback(void)
* Try again to get rid of thread dictionary.
*/
DESTROY(_thread_dictionary);
[NSAutoreleasePool _endThread: self];
if (_autorelease_vars.pool_cache != 0)
{
[NSAutoreleasePool _endThread: self];
}
if (_thread_dictionary != nil)
{
NSLog(@"Oops - leak - thread dictionary is %@", _thread_dictionary);
[NSAutoreleasePool _endThread: self];
if (_autorelease_vars.pool_cache != 0)
{
[NSAutoreleasePool _endThread: self];
}
}
}
if (self == defaultThread)