Fix unnecessary extra pool creation.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22339 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2006-01-20 17:12:33 +00:00
parent 3c2b3f6699
commit 767ed212c6
2 changed files with 8 additions and 2 deletions

View file

@ -231,11 +231,12 @@ static IMP initImp;
NSThread *t = GSCurrentThread();
NSAutoreleasePool *pool;
if (t->_active == NO)
pool = t->_autorelease_vars.current_pool;
if (pool == nil && t->_active == NO)
{
[self new]; // Don't leak while exiting thread.
pool = t->_autorelease_vars.current_pool;
}
pool = t->_autorelease_vars.current_pool;
if (pool != nil)
{
(*pool->_addImp)(pool, @selector(addObject:), anObj);