Re: Re: NSImage TIFFRepresentation memory leak
Re: Re: NSImage TIFFRepresentation memory leak
- Subject: Re: Re: NSImage TIFFRepresentation memory leak
- From: "Shawn Erickson" <email@hidden>
- Date: Fri, 1 Dec 2006 10:09:55 -0800
On 12/1/06, Roland Torres <email@hidden> wrote:
I call TIFFRepresentation since it's the only way I know to write the NSImage out
to a file, but this is called in only one place, and the leak only occurs when I do
that. ... I guess I'll have to live with it for now, unless I can find another way to
generate an image file from the NSImage.
How are you creating you NSImages? What is the source of their image data?
NSImages are in a way an abstraction of a displayable image while the
real image data in contained in an image rep which NSImage may have
one or more of. If your images are bitmap based then look at using
-[NSBitmapImageRep representationUsingType:properties:] to request an
NSData instance with the bitmap data in a particular image format. You
can get the image rep from the NSImage... however it isn't clear how
you are creating your images so it isn't clear what reps they will
contain. Also you can draw an image into a NSBitmapImageRep and then
ask for the format of your choice... or use ImageIO (part of
CoreImage).
Also do you know what memory or object is leaking? It would help to
figure out what it is... I have a feeling it is something related to
the CGL context that is getting created in the process of converting
the image data into TIFF format. I have seen some reports go by on the
quartz and opengl lists of contexts created by CGLCreateContext then
later destroyed by CGLDestroyContext resulting in a leak.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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