• 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
Re: NSImage leaks open file in 10.8.2?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage leaks open file in 10.8.2?


  • Subject: Re: NSImage leaks open file in 10.8.2?
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 13 Feb 2013 13:54:26 -0700

On Feb 13, 2013, at 2:12 AM, norbert <email@hidden> wrote:

> In Mac OS X 10.6.8, it works fine, and closes the image files after use. But in 10.8.2, it keeps every single one of them open.
>
> Here is the code I use:
>
> 	NSImage			*nextImage = [NSImage imageNamed:@"Animator1.png"];
> 	if (nextImage != NULL)
> 		[myImageView setImage:nextImage];
>
> myImageView is a regular NSImageView. The app is non GC, and non ARC.
>
> Is that a new "feature" of Mountain Lion?

Maybe. +imageNamed: does some caching behind the scenes, and this is explained in the method's documentation. If you need image files to be opened, read into memory, and then closed, then the first thing I would try is initializing them from unmapped NSData objects created using +dataWithContentsOfURL:options:error:.

Nick Zitzmann
<http://www.chronosnet.com/>


_______________________________________________

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

  • Follow-Ups:
    • Re: NSImage leaks open file in 10.8.2?
      • From: Kyle Sluder <email@hidden>
References: 
 >NSImage leaks open file in 10.8.2? (From: norbert <email@hidden>)

  • Prev by Date: Re: NSUserNotificationCenter: Spoofing the app name/icon?
  • Next by Date: iOS Document Interaction Technology
  • Previous by thread: NSImage leaks open file in 10.8.2?
  • Next by thread: Re: NSImage leaks open file in 10.8.2?
  • Index(es):
    • Date
    • Thread