mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
(NSDecrementExtraRefCountWasZero): Return correct value.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@452 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6d694e5630
commit
2e20b94ea0
1 changed files with 6 additions and 8 deletions
|
@ -70,17 +70,15 @@ void NSIncrementExtraRefCount(id anObject)
|
|||
|
||||
BOOL NSDecrementExtraRefCountWasZero(id anObject)
|
||||
{
|
||||
BOOL wasZero = YES;
|
||||
coll_node_ptr n;
|
||||
|
||||
n = coll_hash_node_for_key(retain_counts, anObject);
|
||||
if (n)
|
||||
{
|
||||
(n->value.unsigned_int_u)--;
|
||||
if (n->value.unsigned_int_u)
|
||||
return NO;
|
||||
coll_hash_remove(retain_counts, anObject);
|
||||
}
|
||||
return YES;
|
||||
if (!n) return wasZero;
|
||||
if (n->value.unsigned_int_u) wasZero = NO;
|
||||
if (!--n->value.unsigned_int_u)
|
||||
coll_hash_remove(retain_counts, anObject);
|
||||
return wasZero;
|
||||
}
|
||||
|
||||
@implementation NSObject
|
||||
|
|
Loading…
Reference in a new issue