• 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
NSImage TIFFRepresentation memory leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSImage TIFFRepresentation memory leak
      • From: j o a r <email@hidden>
  • Prev by Date: Re: NSTask interactive question
  • Next by Date: Re: NSTask memory leak
  • Previous by thread: Re: Re: NSTask interactive question
  • Next by thread: Re: NSImage TIFFRepresentation memory leak
  • Index(es):
    • Date
    • Thread