mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
fix for bug # 44240
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38340 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
40bfec157a
commit
b24b33e2bb
2 changed files with 30 additions and 18 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2015-02-14 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSThread.m: Be more agressive about releasing thread
|
||||||
|
resources when a thread exists (in particular release the
|
||||||
|
thread's runloop repeatedly for bug #44240) in case of the
|
||||||
|
deallocation of objects causing re-population of thread data.
|
||||||
|
|
||||||
2015-02-07 Richard Frith-Macdonald <rfm@gnu.org>
|
2015-02-07 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSData.m: Simplify mingw/unixy ifdefs for writing a file.
|
* Source/NSData.m: Simplify mingw/unixy ifdefs for writing a file.
|
||||||
|
|
|
@ -710,18 +710,14 @@ unregisterActiveThread(NSThread *thread)
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
|
int retries = 0;
|
||||||
|
|
||||||
if (_active == YES)
|
if (_active == YES)
|
||||||
{
|
{
|
||||||
[NSException raise: NSInternalInconsistencyException
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"Deallocating an active thread without [+exit]!"];
|
format: @"Deallocating an active thread without [+exit]!"];
|
||||||
}
|
}
|
||||||
if (_runLoopInfo != 0)
|
DESTROY(_runLoopInfo);
|
||||||
{
|
|
||||||
GSRunLoopThreadInfo *info = (GSRunLoopThreadInfo*)_runLoopInfo;
|
|
||||||
|
|
||||||
_runLoopInfo = 0;
|
|
||||||
[info release];
|
|
||||||
}
|
|
||||||
DESTROY(_thread_dictionary);
|
DESTROY(_thread_dictionary);
|
||||||
DESTROY(_target);
|
DESTROY(_target);
|
||||||
DESTROY(_arg);
|
DESTROY(_arg);
|
||||||
|
@ -731,24 +727,33 @@ unregisterActiveThread(NSThread *thread)
|
||||||
[NSAutoreleasePool _endThread: self];
|
[NSAutoreleasePool _endThread: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_thread_dictionary != nil)
|
while ((_thread_dictionary != nil || _runLoopInfo != nil) && retries++ < 10)
|
||||||
{
|
{
|
||||||
/*
|
/* Try again.
|
||||||
* Try again to get rid of thread dictionary.
|
|
||||||
*/
|
*/
|
||||||
|
DESTROY(_runLoopInfo);
|
||||||
DESTROY(_thread_dictionary);
|
DESTROY(_thread_dictionary);
|
||||||
if (_autorelease_vars.pool_cache != 0)
|
if (_autorelease_vars.pool_cache != 0)
|
||||||
{
|
{
|
||||||
[NSAutoreleasePool _endThread: self];
|
[NSAutoreleasePool _endThread: self];
|
||||||
}
|
}
|
||||||
if (_thread_dictionary != nil)
|
}
|
||||||
{
|
|
||||||
NSLog(@"Oops - leak - thread dictionary is %@", _thread_dictionary);
|
if (_runLoopInfo != nil)
|
||||||
if (_autorelease_vars.pool_cache != 0)
|
{
|
||||||
{
|
NSLog(@"Oops - leak - run loop is %@", _runLoopInfo);
|
||||||
[NSAutoreleasePool _endThread: self];
|
if (_autorelease_vars.pool_cache != 0)
|
||||||
}
|
{
|
||||||
}
|
[NSAutoreleasePool _endThread: self];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_thread_dictionary != nil)
|
||||||
|
{
|
||||||
|
NSLog(@"Oops - leak - thread dictionary is %@", _thread_dictionary);
|
||||||
|
if (_autorelease_vars.pool_cache != 0)
|
||||||
|
{
|
||||||
|
[NSAutoreleasePool _endThread: self];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DESTROY(_gcontext);
|
DESTROY(_gcontext);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue