mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Do retain/release/autorelease of contents as appropriate.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@136 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
264d951458
commit
dac4ec0f04
3 changed files with 7 additions and 3 deletions
|
@ -380,6 +380,7 @@ static id nilBinaryTreeNode;
|
|||
[theParent setRightNode:newElement.id_u];
|
||||
}
|
||||
_count++;
|
||||
RETAIN_ELT(newElement);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -418,6 +419,7 @@ static id nilBinaryTreeNode;
|
|||
[newElement.id_u setParentNode:[self nilNode]];
|
||||
}
|
||||
_count++;
|
||||
RETAIN_ELT(newElement);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -449,6 +451,7 @@ static id nilBinaryTreeNode;
|
|||
[newElement.id_u setParentNode:[self nilNode]];
|
||||
}
|
||||
_count++;
|
||||
RETAIN_ELT(newElement);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -523,7 +526,7 @@ static id nilBinaryTreeNode;
|
|||
[oldElement.id_u setLeftNode:[self nilNode]];
|
||||
[oldElement.id_u setParentNode:[self nilNode]];
|
||||
_count--;
|
||||
return oldElement;
|
||||
return AUTORELEASE_ELT(oldElement);
|
||||
}
|
||||
|
||||
- withElementsCall: (void(*)(elt))aFunc whileTrue: (BOOL*)flag
|
||||
|
|
|
@ -209,6 +209,7 @@
|
|||
{
|
||||
if (coll_hash_value_for_key(_contents_hash, anElement).void_ptr_u == 0)
|
||||
coll_hash_add(&_contents_hash, anElement, 1);
|
||||
RETAIN_ELT(anElement);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -221,7 +222,7 @@
|
|||
coll_hash_remove(_contents_hash, oldElement);
|
||||
else
|
||||
RETURN_BY_CALLING_EXCEPTION_FUNCTION(excFunc);
|
||||
return oldElement;
|
||||
return AUTORELEASE_ELT(oldElement);
|
||||
}
|
||||
|
||||
/* This must work without sending any messages to content objects */
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
[super removeElement:anElement];
|
||||
if (parent && parent != [self nilNode])
|
||||
[self splayNode:parent];
|
||||
return anElement;
|
||||
return AUTORELEASE_ELT(anElement);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue