Re: Garbage Collection, Core Foundation, and toll-free bridging
Re: Garbage Collection, Core Foundation, and toll-free bridging
- Subject: Re: Garbage Collection, Core Foundation, and toll-free bridging
- From: Rob Keniger <email@hidden>
- Date: Thu, 6 Aug 2009 13:30:54 +1000
On 06/08/2009, at 1:11 PM, Marco S Hyman wrote:
I assume that just because I can toll-free bridge something
between core foundation and NSFoo I still have to worry about
CFretain/CFrelease in a GC app. Correct?
Example:
Assume image is an CGImageSourceRef.
NSDictionary *metadata =
(NSDictionary *) CGImageSourceCopyPropertiesAtIndex(image, 0, NULL);
....
CFRelease((CFDictionaryRef) metadata);
or alternately
NSDictionary *metadata = (NSDictionary *)
NSMakeCollectable(CGImageSourceCopyPropertiesAtIndex(image, 0,
NULL));
Is that correct?
Please don't start a new topic by replying to an existing thread,
create a new message.
To answer your question: Yes.
http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcCoreFoundation.html
--
Rob Keniger
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden