mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Make CFRetain() / CFRelease() behaviour dependent on GC mode.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33177 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ae40941018
commit
93218b86ba
1 changed files with 13 additions and 2 deletions
|
@ -33,12 +33,23 @@ static NSGarbageCollector *collector = nil;
|
|||
|
||||
id CFRetain(id obj)
|
||||
{
|
||||
return objc_gc_retain(obj);
|
||||
if (collector)
|
||||
{
|
||||
return objc_gc_retain(obj);
|
||||
}
|
||||
return [obj retain];
|
||||
}
|
||||
|
||||
void CFRelease(id obj)
|
||||
{
|
||||
objc_gc_release(obj);
|
||||
if (collector)
|
||||
{
|
||||
objc_gc_release(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
[obj release];
|
||||
}
|
||||
}
|
||||
|
||||
@implementation NSGarbageCollector
|
||||
|
|
Loading…
Reference in a new issue