mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
(objc_set_autorelease_class): New function.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a81992cb18
commit
42c7813c9d
1 changed files with 14 additions and 0 deletions
|
@ -33,6 +33,9 @@
|
|||
/* The hashtable of retain counts on objects */
|
||||
static coll_cache_ptr retain_counts = NULL;
|
||||
|
||||
/* The Class responsible for handling autorelease's */
|
||||
static id autorelease_class = nil;
|
||||
|
||||
static void
|
||||
init_retain_counts_if_necessary()
|
||||
{
|
||||
|
@ -91,6 +94,11 @@ objc_retain_count (id anObj)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
objc_set_autorelease_class (id the_autorelease_class)
|
||||
{
|
||||
auto_release_class = the_autorelease_class;
|
||||
}
|
||||
|
||||
@implementation Object (RetainingObject)
|
||||
|
||||
|
@ -115,4 +123,10 @@ objc_retain_count (id anObj)
|
|||
return objc_retain_count(self);
|
||||
}
|
||||
|
||||
- autorelease
|
||||
{
|
||||
[the_autorelease_class addObject:self];
|
||||
returnself;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue