mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
Thread fixes for NSConnection
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8174 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d84f89cc45
commit
6c5c018c86
6 changed files with 29 additions and 14 deletions
|
@ -226,16 +226,13 @@ gnustep_base_thread_callback()
|
|||
[[NSNotificationCenter defaultCenter] postNotification: n];
|
||||
RELEASE(n);
|
||||
|
||||
/*
|
||||
* Release anything in our autorelease pools
|
||||
*/
|
||||
[NSAutoreleasePool _endThread];
|
||||
|
||||
/*
|
||||
* destroy the thread object.
|
||||
*/
|
||||
DESTROY(t);
|
||||
|
||||
objc_thread_set_data (NULL);
|
||||
|
||||
/*
|
||||
* Tell the runtime to exit the thread
|
||||
*/
|
||||
|
@ -332,9 +329,12 @@ gnustep_base_thread_callback()
|
|||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Deallocating an active thread without [+exit]!"];
|
||||
}
|
||||
_deallocating = YES;
|
||||
DESTROY(_thread_dictionary);
|
||||
DESTROY(_target);
|
||||
DESTROY(_arg);
|
||||
[NSAutoreleasePool _endThread: self];
|
||||
|
||||
NSDeallocateObject(self);
|
||||
}
|
||||
|
||||
|
@ -395,7 +395,7 @@ gnustep_base_thread_callback()
|
|||
*/
|
||||
- (NSMutableDictionary*) threadDictionary
|
||||
{
|
||||
if (_thread_dictionary == nil)
|
||||
if (_thread_dictionary == nil && _deallocating == NO)
|
||||
{
|
||||
_thread_dictionary = [NSMutableDictionary new];
|
||||
}
|
||||
|
@ -450,14 +450,12 @@ gnustep_base_thread_callback()
|
|||
* Set the thread to be inactive to avoid any possibility of recursion.
|
||||
*/
|
||||
thread->_active = NO;
|
||||
/*
|
||||
* Release anything in our autorelease pools
|
||||
*/
|
||||
[NSAutoreleasePool _endThread];
|
||||
|
||||
/*
|
||||
* destroy the thread object.
|
||||
*/
|
||||
DESTROY (thread);
|
||||
|
||||
objc_thread_set_data (NULL);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue