Re: Should we release a CGImage created from NSBitmapImageRep ?
Re: Should we release a CGImage created from NSBitmapImageRep ?
- Subject: Re: Should we release a CGImage created from NSBitmapImageRep ?
- From: Clark Cox <email@hidden>
- Date: Sun, 6 Sep 2009 08:30:39 -0700
On Sun, Sep 6, 2009 at 4:13 AM, DairyKnight<email@hidden> wrote:
> I'm working on a program which does lots of switching between CGImage,
> CIIMage and NSImage. One thing I found out is
> that it seems if you get a CGImage from NSBitmapImageRep:
>
> CGImage *cgImg = [NSBitmapImageRep CGImage];
Nothing about the method name suggests that it returns an object with
an outstanding reference (i.e. it doesn't have copy in it's name, it
doesn't start with copy or new, etc.). Absent any of these indicators
(described in <http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/20000994-BAJHFBGH>)
you must assume that you do not hold an outstanding reference, and
therefore must not release it.
Once you commit, to memory, the 4 rules described at the above link,
all the information you need to determine the status of a returned
object are in the method name.
--
Clark S. Cox III
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