mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 07:20:50 +00:00
Allow the retain count to become 0.
With the new retain count scheme, it must reach 0 or double frees won't be caught.
This commit is contained in:
parent
ef0f30935f
commit
951bed6206
1 changed files with 6 additions and 3 deletions
|
@ -292,10 +292,13 @@ BOOL (id object) object_is_meta_class = #0;
|
|||
|
||||
- (/*oneway*/ void) release
|
||||
{
|
||||
if ([self retainCount] == 1) // don't let retain count reach zero
|
||||
int rc;
|
||||
|
||||
rc = obj_decrement_retaincount (self);
|
||||
if (rc < 0)
|
||||
obj_error (self, 0, "retain count went negative");
|
||||
if (rc == 0)
|
||||
[self dealloc];
|
||||
else
|
||||
obj_decrement_retaincount (self);
|
||||
}
|
||||
|
||||
- (id) autorelease
|
||||
|
|
Loading…
Reference in a new issue