Re: CGImageRef as a property of a cocoa object
Re: CGImageRef as a property of a cocoa object
- Subject: Re: CGImageRef as a property of a cocoa object
- From: Dave <email@hidden>
- Date: Sun, 22 Sep 2013 11:54:10 +0100
On 22 Sep 2013, at 10:07, Graham Cox <email@hidden> wrote:
>
> On 21/09/2013, at 5:13 PM, Dave <email@hidden> wrote:
>
>> Also CF objects will throw an exception if you call release with a nil pointer, so you can check for this in your setter.
>
>
> Not if there is a specific retain/release function such as CGImageRetain, CGImageRelease. These ignore nil. You should always use these instead of a generic CFRelease because they may do additional work for all we know.
That's true, although its probably better to check in either case rather than make an unnecessary CF call. According to the documentation CFRelease or the specialised version can be called, If you have already checked for nil, then there is no reason to have CF do it again I suppose so use CFRelease.
All the Best
Dave
_______________________________________________
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