• 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: Kyle Sluder <email@hidden>
  • Date: Wed, 13 Feb 2013 13:50:09 -0800

On Wed, Feb 13, 2013, at 12:54 PM, Nick Zitzmann wrote:
>
> 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:.

Easier than that, you can just call -setCacheMode:NSImageCacheNever to
disable caching.

--Kyle Sluder
_______________________________________________

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

References: 
 >NSImage leaks open file in 10.8.2? (From: norbert <email@hidden>)
 >Re: NSImage leaks open file in 10.8.2? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Pointer was being free was not allocated
  • Next by Date: Re: iOS Document Interaction Technology
  • Previous by thread: Re: NSImage leaks open file in 10.8.2?
  • Next by thread: [solved] Re: NSImage leaks open file in 10.8.2?
  • Index(es):
    • Date
    • Thread