Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage TIFFRepresentation memory leak



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.