mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 17:12:03 +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 NSDecrementExtraRefCountWasZero(id anObject)
|
||||||
{
|
{
|
||||||
|
BOOL wasZero = YES;
|
||||||
coll_node_ptr n;
|
coll_node_ptr n;
|
||||||
|
|
||||||
n = coll_hash_node_for_key(retain_counts, anObject);
|
n = coll_hash_node_for_key(retain_counts, anObject);
|
||||||
if (n)
|
if (!n) return wasZero;
|
||||||
{
|
if (n->value.unsigned_int_u) wasZero = NO;
|
||||||
(n->value.unsigned_int_u)--;
|
if (!--n->value.unsigned_int_u)
|
||||||
if (n->value.unsigned_int_u)
|
coll_hash_remove(retain_counts, anObject);
|
||||||
return NO;
|
return wasZero;
|
||||||
coll_hash_remove(retain_counts, anObject);
|
|
||||||
}
|
|
||||||
return YES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation NSObject
|
@implementation NSObject
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue