mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +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
f976a19bd6
commit
dce58731aa
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>
|
||||
|
||||
* Source/NSURL.m: When initialising with schem, host and path, allow
|
||||
|
|
|
@ -179,13 +179,15 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
|
|||
{
|
||||
if (_mutex != 0)
|
||||
{
|
||||
objc_mutex_t tmp = _MUTEX;
|
||||
|
||||
_mutex = 0;
|
||||
// Ask the runtime to deallocate the mutex
|
||||
// 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);
|
||||
}
|
||||
_mutex = 0;
|
||||
}
|
||||
DESTROY(_name);
|
||||
}
|
||||
|
@ -335,17 +337,23 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
|
|||
{
|
||||
if (_condition != 0)
|
||||
{
|
||||
objc_condition_t tmp = _CONDITION;
|
||||
|
||||
_condition = 0;
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
if (_mutex != 0)
|
||||
{
|
||||
objc_mutex_t tmp = _MUTEX;
|
||||
|
||||
_mutex = 0;
|
||||
// Ask the runtime to deallocate the mutex
|
||||
// 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);
|
||||
}
|
||||
|
@ -650,13 +658,15 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
|
|||
{
|
||||
if (_mutex != 0)
|
||||
{
|
||||
objc_mutex_t tmp = _MUTEX;
|
||||
|
||||
_mutex = 0;
|
||||
// Ask the runtime to deallocate the mutex
|
||||
// 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);
|
||||
}
|
||||
_mutex = 0;
|
||||
}
|
||||
DESTROY(_name);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue