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

[solved] Re: NSImage leaks open file in 10.8.2?


  • Subject: [solved] Re: NSImage leaks open file in 10.8.2?
  • From: norbert <email@hidden>
  • Date: Fri, 15 Feb 2013 18:30:47 +0100

Thanks a lot for your comments. I have tried to set setCacheMode:NSImageCacheNever, but that still left the file open.

But I have changed my code to use this now:

	NSImage		*result = [[NSImage alloc] initByReferencingFile:[[NSBundle mainBundle] pathForResource:[theName stringByDeletingPathExtension] ofType:@"png"]];
	[result autorelease];

And this works!!! No more image files left open. That is definitely a bug in Mac OS X 10.8.2, I can't believe this is intended behavior…

Yours,


> while testing the latest version of my software in 10.8.2, I noticed that there are a lot of open files, more than in 10.6.8.
>
> I tracked it down to an animation I use, and the png files I load for that.
>
> 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?
>
> The problem is that my software deals with a LOT of files, and so it would be nice to keep the number of open files as small as possible at any time.
>
> And ideas?

Norbert M. Doerner
email@hidden

CEO, West-Forest-Systems
In der Trift 13
56459 Langenhahn, Germany
Fon: +49 (2663) 91 70 128	(Central European Time Zone...)
Fax: +49 (2663) 91 70 126
AIM (iChat), Skype: cdfinderceo
Twitter: http://www.twitter.com/neofinder
Facebook: http://www.facebook.com/NeoFinder
---------------------------------------------------------------------------------------------------
NeoFinder - The Search Is Over!  http://www.neofinder.de/
Catalog and organize your photos, music, videos, disks, data, anything...
NEW:  NeoFinder 6.0.1 for Mac (was CDFinder)
---------------------------------------------------------------------------------------------------
_______________________________________________

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: [solved] 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: Binding a NSArrayController to a NSPopupButtonn & NSTextField
  • Next by Date: Re: [solved] Re: NSImage leaks open file in 10.8.2?
  • Previous by thread: Re: NSImage leaks open file in 10.8.2?
  • Next by thread: Re: [solved] Re: NSImage leaks open file in 10.8.2?
  • Index(es):
    • Date
    • Thread