• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Should we release a CGImage created from NSBitmapImageRep ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Should we release a CGImage created from NSBitmapImageRep ? (From: DairyKnight <email@hidden>)

  • Prev by Date: Re: How to stop NSImage from resizing while calling 'drawInRect' ?
  • Next by Date: NSArrayController design/usage question
  • Previous by thread: Re: Should we release a CGImage created from NSBitmapImageRep ?
  • Next by thread: Symbolic Links in Snow Leopard
  • Index(es):
    • Date
    • Thread