• 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: bitmap caching issue (was: settings to build for 10.5 on 10.6?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?)


  • Subject: Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?)
  • From: Ken Ferry <email@hidden>
  • Date: Sun, 20 Sep 2009 14:22:45 -0700

On Sun, Sep 20, 2009 at 1:37 PM, Matt Neuburg <email@hidden> wrote:

> On or about 9/20/09 1:16 PM, thus spake "Ken Ferry" <email@hidden>:
>
> > There was an ownership problem.  The NSBitmapImageRep owned a raw buffer
> of
> > data and the CGImage.  The CGImage didn't retain the NSBitmapImageRep
> since
> > that would cause a retain cycle.
>
> So all I had to do was retain the NSBitmapImageRep! I never thought of
> that!!! Argh! [Falls on own sword in despair, is carried off the stage.] m.
>

Well, yes, but copying the data out one way or another is probably safer.
:-)

Once you've passed a CGImage to some other API, you really don't know how
long it'll survive, so it's hard to say when it would be safe to release the
NSBitmapImageRep.

Notably, during printing, even CGContextDrawImage retains the CGImage rather
than using it right away.  The CGImage is retained until the current page is
finished.

-Ken
_______________________________________________

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

  • Follow-Ups:
    • Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?)
      • From: Rob Keniger <email@hidden>
References: 
 >Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?) (From: Ken Ferry <email@hidden>)
 >Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?) (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?)
  • Next by Date: Re: MutableDictionary setValue:forKeyPath - strange behavior
  • Previous by thread: Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?)
  • Next by thread: Re: bitmap caching issue (was: settings to build for 10.5 on 10.6?)
  • Index(es):
    • Date
    • Thread