mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
379998f2bb
commit
89c02c3a8b
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…
Add table
Add a link
Reference in a new issue