Re: Guidelines for Cocoa frameworks supporting garbage collection?
Re: Guidelines for Cocoa frameworks supporting garbage collection?
- Subject: Re: Guidelines for Cocoa frameworks supporting garbage collection?
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 06 Jul 2008 08:46:07 -0400
- Thread-topic: Guidelines for Cocoa frameworks supporting garbage collection?
on 2008-07-06 1:07 AM, Chris Hanson at email@hidden wrote:
> On Jul 5, 2008, at 3:52 PM, Quincey Morris wrote:
>
>> The other thing worth noting is that, when GC is enabled, any CF
>> object that is documented to be *returned* already autoreleased from
>> a frameworks function is actually returned with a reference count of
>> 1, so you still need to call CFMakeCollectable yourself in that
>> case, even though you wouldn't follow it with a call to autorelease
>> like you would in Chris's examples.
>
> I don't believe this is the case. Can you give an example of a
> framework method that's documented to return an autoreleased CF object?
>
> I would assume that the result of such a method has already had
> CFMakeCollectable called on it, making doing so unnecessary.
I don't question Quincey's experience with -[QTMovie
frameImageAtTime:withAttributes:error:], which I haven't looked at. But I
agree with Chris as to the NSEvent methods I describe in another post, and
the similar methods in my own frameworks. In these cases, when the Cocoa
object goes away, its CFType-derived counterpart also goes away.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com
PreFab Software - www.prefabsoftware.com
_______________________________________________
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