mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 17:51:01 +00:00
clear ivars when deallocating
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27303 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
490c0b240c
commit
a4f370cebb
2 changed files with 20 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2008-12-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSLock.m: Tiny cleanup of lock finalisation process.
|
||||||
|
|
||||||
2008-12-15 Richard Frith-Macdonald <rfm@gnu.org>
|
2008-12-15 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSURL.m: When initialising with schem, host and path, allow
|
* Source/NSURL.m: When initialising with schem, host and path, allow
|
||||||
|
|
|
@ -179,13 +179,15 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
|
||||||
{
|
{
|
||||||
if (_mutex != 0)
|
if (_mutex != 0)
|
||||||
{
|
{
|
||||||
|
objc_mutex_t tmp = _MUTEX;
|
||||||
|
|
||||||
|
_mutex = 0;
|
||||||
// Ask the runtime to deallocate the mutex
|
// Ask the runtime to deallocate the mutex
|
||||||
// If there are outstanding locks then it will block
|
// If there are outstanding locks then it will block
|
||||||
if (objc_mutex_deallocate(_MUTEX) == -1)
|
if (objc_mutex_deallocate(tmp) == -1)
|
||||||
{
|
{
|
||||||
NSWarnMLog(@"objc_mutex_deallocate() failed for %@", self);
|
NSWarnMLog(@"objc_mutex_deallocate() failed for %@", self);
|
||||||
}
|
}
|
||||||
_mutex = 0;
|
|
||||||
}
|
}
|
||||||
DESTROY(_name);
|
DESTROY(_name);
|
||||||
}
|
}
|
||||||
|
@ -335,17 +337,23 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
|
||||||
{
|
{
|
||||||
if (_condition != 0)
|
if (_condition != 0)
|
||||||
{
|
{
|
||||||
|
objc_condition_t tmp = _CONDITION;
|
||||||
|
|
||||||
|
_condition = 0;
|
||||||
// Ask the runtime to deallocate the condition
|
// Ask the runtime to deallocate the condition
|
||||||
if (objc_condition_deallocate(_CONDITION) == -1)
|
if (objc_condition_deallocate(tmp) == -1)
|
||||||
{
|
{
|
||||||
NSWarnMLog(@"objc_condition_deallocate() failed for %@", self);
|
NSWarnMLog(@"objc_condition_deallocate() failed for %@", self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_mutex != 0)
|
if (_mutex != 0)
|
||||||
{
|
{
|
||||||
|
objc_mutex_t tmp = _MUTEX;
|
||||||
|
|
||||||
|
_mutex = 0;
|
||||||
// Ask the runtime to deallocate the mutex
|
// Ask the runtime to deallocate the mutex
|
||||||
// If there are outstanding locks then it will block
|
// If there are outstanding locks then it will block
|
||||||
if (objc_mutex_deallocate(_MUTEX) == -1)
|
if (objc_mutex_deallocate(tmp) == -1)
|
||||||
{
|
{
|
||||||
NSWarnMLog(@"objc_mutex_deallocate() failed for %@", self);
|
NSWarnMLog(@"objc_mutex_deallocate() failed for %@", self);
|
||||||
}
|
}
|
||||||
|
@ -650,13 +658,15 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
|
||||||
{
|
{
|
||||||
if (_mutex != 0)
|
if (_mutex != 0)
|
||||||
{
|
{
|
||||||
|
objc_mutex_t tmp = _MUTEX;
|
||||||
|
|
||||||
|
_mutex = 0;
|
||||||
// Ask the runtime to deallocate the mutex
|
// Ask the runtime to deallocate the mutex
|
||||||
// If there are outstanding locks then it will block
|
// If there are outstanding locks then it will block
|
||||||
if (objc_mutex_deallocate(_MUTEX) == -1)
|
if (objc_mutex_deallocate(tmp) == -1)
|
||||||
{
|
{
|
||||||
NSWarnMLog(@"objc_mutex_deallocate() failed for %@", self);
|
NSWarnMLog(@"objc_mutex_deallocate() failed for %@", self);
|
||||||
}
|
}
|
||||||
_mutex = 0;
|
|
||||||
}
|
}
|
||||||
DESTROY(_name);
|
DESTROY(_name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue