[solved] Re: NSImage leaks open file in 10.8.2?
[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