Re: can you autorelease toll-free bridged types
Re: can you autorelease toll-free bridged types
- Subject: Re: can you autorelease toll-free bridged types
- From: Roland King <email@hidden>
- Date: Wed, 1 Sep 2010 00:34:45 +0800
Thanks for the confirmation ... in this case I'm doing Middles Ages iOs memory managed code so definitely not dual mode.
Of course I now have to ask if I *were* doing it .. what's the issue? Is it that autorelease doesn't do anything so the CF type never gets the CFRelease() call it would do from a real -release? What does CFMakeCollectable() do if you are memory managed .. nothing? These are things I've not had to worry about but you piqued my interest.
On 01-Sep-2010, at 12:24 AM, Dave DeLong wrote:
> If you are writing dual-mode code, can't you just wrap the CFDictionaryCreateMutable() call with CFMakeCollectable()?
>
> Dave
>
> On Aug 31, 2010, at 10:20 AM, Mike Abdullah wrote:
>
>> On 31 Aug 2010, at 17:02, Roland King wrote:
>>
>>> can you do this?
>>>
>>> CFMutableDictionaryRef tokenByParent = CFDictionaryCreateMutable( NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks );
>>> [ (NSMutableDictionary*)tokenByParent autorelease ];
>>>
>>
>> Yes, provided you are not writing dual-mode GC/manual memory management code. The Static Analyzer will do a good job warning you of this anyhow.
> _______________________________________________
>
> 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
_______________________________________________
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