NSImage TIFFRepresentation memory leak
NSImage TIFFRepresentation memory leak
- Subject: NSImage TIFFRepresentation memory leak
- From: Roland Torres <email@hidden>
- Date: Wed, 29 Nov 2006 12:25:51 -0800
Is there a known memory leaking problem with using NSImage -
TIFFRepresentation in a multithreaded Cocoa environment?
In my app, I do the TIFFRepresentation call on the main thread, using
-performSelectorOnMainThread:::. It works and gives me a valid TIFF
representation, but leaks like a '63 VW Bug. The representation ought
to be returned autoreleased, and I have it in its own autorelease pool:
NSImage *anImage = ...;
. . .
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[anImage lockFocus];
NSData *nsData = [anImage TIFFRepresentation]; // <-- Leak City
[anImage unlockFocus];
[nsData writeToFile::]; // <-- No leak here
[pool release];
. . .
The memory, ay, she adds up muy quickly, according to about 4X the
size of the images run through it. If I comment out the
TIFFRepresentation line, no leak occurs. I can't seem reproduce this
in a simple standalone app, so there must be some sort of rather
complex interaction going on somewhere. I really don't know how to
track it down. Any ideas?
Roland
_______________________________________________
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