Re: Non-NSObject object and garbage collection
Re: Non-NSObject object and garbage collection
- Subject: Re: Non-NSObject object and garbage collection
- From: Quincey Morris <email@hidden>
- Date: Tue, 12 Aug 2008 23:30:31 -0700
On Aug 12, 2008, at 22:52, Ken Ferry wrote:
In general, you don't need to CFRetain an object to keep it alive
while it's on the stack. The fact that it's on the stack is enough.
If this wasn't true, there'd be a race, since the collector might
destroy the object before you retained it.
Unless I misunderstand your point, its being on the stack will only
keep it alive if CFMakeCollectable has already been called on it. In a
case where you're given a CF-type object that you don't own, I don't
think you can assume that. If it has not been made collectable, it's
being kept alive by a non-zero retain count, or by having being
autoreleased, either of which will keep it alive long enough for you
to retain it.
_______________________________________________
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