• 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
Should we release a CGImage created from NSBitmapImageRep ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Should we release a CGImage created from NSBitmapImageRep ?


  • Subject: Should we release a CGImage created from NSBitmapImageRep ?
  • From: DairyKnight <email@hidden>
  • Date: Sun, 6 Sep 2009 19:13:11 +0800

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];

And later you release it, by:

CGImageRelease(cgImg);

It would cause a BAD_ACCESS error. The same thing happened when you have a
NSBitmapImageRep created from CGImage.

outputBitmapRep = [[[NSBitmapImageRep alloc] initWithCGImage:cgImg]
autorelease];
CGImageRelease(cgImg); ----> This causes BAD_ACCESS when the pool drains.

So is it true that those routines only get a reference to the image?

Thanks.

Regards,
DairyKnight
_______________________________________________

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: Should we release a CGImage created from NSBitmapImageRep ?
      • From: Clark Cox <email@hidden>
    • Re: Should we release a CGImage created from NSBitmapImageRep ?
      • From: Dave Keck <email@hidden>
  • Prev by Date: NSAppleScript error
  • Next by Date: Re: Should we release a CGImage created from NSBitmapImageRep ?
  • Previous by thread: Re: NSAppleScript error
  • Next by thread: Re: Should we release a CGImage created from NSBitmapImageRep ?
  • Index(es):
    • Date
    • Thread