mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
Fix potential crash while closing a message port.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27060 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d4117b5010
commit
082dc66e43
2 changed files with 17 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-11-15 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSMessagePort.m (-invalidate, -removeHandle:): Fix
|
||||||
|
potential crash while closing a message port.
|
||||||
|
|
||||||
2008-11-14 Wolfgang Lux <wolfgang.lux@gmail.com>
|
2008-11-14 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* Source/NSProcessInfo.m (-processorCount, -activeProcessorCount):
|
* Source/NSProcessInfo.m (-processorCount, -activeProcessorCount):
|
||||||
|
|
|
@ -1571,7 +1571,11 @@ typedef struct {
|
||||||
{
|
{
|
||||||
if ([self isValid] == YES)
|
if ([self isValid] == YES)
|
||||||
{
|
{
|
||||||
M_LOCK(myLock);
|
/* Copy the lock into a local variable since the _internal structure
|
||||||
|
* may be freed during the call to [super invalidate]
|
||||||
|
*/
|
||||||
|
NSRecursiveLock *lock = ((internal*)_internal)->_myLock;
|
||||||
|
M_LOCK(lock);
|
||||||
|
|
||||||
if ([self isValid] == YES)
|
if ([self isValid] == YES)
|
||||||
{
|
{
|
||||||
|
@ -1612,7 +1616,7 @@ typedef struct {
|
||||||
[[NSMessagePortNameServer sharedInstance] removePort: self];
|
[[NSMessagePortNameServer sharedInstance] removePort: self];
|
||||||
[super invalidate];
|
[super invalidate];
|
||||||
}
|
}
|
||||||
M_UNLOCK(myLock);
|
M_UNLOCK(lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1716,7 +1720,11 @@ typedef struct {
|
||||||
|
|
||||||
- (void) removeHandle: (GSMessageHandle*)handle
|
- (void) removeHandle: (GSMessageHandle*)handle
|
||||||
{
|
{
|
||||||
M_LOCK(myLock);
|
/* Copy the lock into a local variable since the _internal structure
|
||||||
|
* may be freed during the call to [self invalidate]
|
||||||
|
*/
|
||||||
|
NSRecursiveLock *lock = ((internal*)_internal)->_myLock;
|
||||||
|
M_LOCK(lock);
|
||||||
if ([handle sendPort] == self)
|
if ([handle sendPort] == self)
|
||||||
{
|
{
|
||||||
if (handle->caller != YES)
|
if (handle->caller != YES)
|
||||||
|
@ -1741,7 +1749,7 @@ typedef struct {
|
||||||
{
|
{
|
||||||
[self invalidate];
|
[self invalidate];
|
||||||
}
|
}
|
||||||
M_UNLOCK(myLock);
|
M_UNLOCK(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue