Re: Non-NSObject object and garbage collection
Re: Non-NSObject object and garbage collection
- Subject: Re: Non-NSObject object and garbage collection
- From: Jean-Daniel Dupas <email@hidden>
- Date: Mon, 11 Aug 2008 14:34:08 +0200
Le 11 août 08 à 14:25, Antonio Nunes a écrit :
On 11 Aug 2008, at 13:14, Antonio Nunes wrote:
Will it cause a memory leak if I treat the Quartz object in the same
way as I do to all my NSObject descendants, i.e. no retains and rely
only on garbage collection?
You either take care of the object's life time manually as you
would in a non-garbage collected environment, or you explicitly
move it into the realm of the garbage collector. Lookup
"CFMakeCollectable" and "NSMakeCollectable" in the docs.
I should add: read the "Memory Management Semantics" in "Using Core
Foundation with Garbage Collection" in the "Garbage Collection
Programming Guide", which has a thorough explanation of how to
handle CF objects under GC.
António
And note also that CoreGraphics objects (CGXxxxRef) are CFTypeRef
(Core Foundation based objects).
_______________________________________________
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