Should we release a CGImage created from NSBitmapImageRep ?
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