• 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: Does [NSApp setApplicationIconImage] leak memory?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does [NSApp setApplicationIconImage] leak memory?


  • Subject: Re: Does [NSApp setApplicationIconImage] leak memory?
  • From: Mark Allan <email@hidden>
  • Date: Sat, 9 Aug 2008 22:46:14 +0100

>Your idea of removing the
array from the equation also solves the leak and I suspect is more
efficient than creating and releasing a tonne of autorelease pools.

Really? Can you explain what "removing the array from the equation" has to do with the memory behavior you're seeing? m.

No, sadly I can't explain it, but it does prevent the memory from leaking.

I changed my initialiser calls from
NSArray *imageX = [[NSArray arrayWithObjects: [NSImage imageNamed:@"menu_frame1"], [NSImage imageNamed:@"dock_frame1"], nil] retain];


to

NSImage *dockImageX = [[NSImage imageNamed:@"dock_frame1"] retain];

and for each frame of the animation, I'm passing that NSImage directly to the [NSApp setApplicationIconImage:theNewImage] call. Even without the autorelease pools, the app's memory usage now stays constant after the first animation of all 8 frames.

I fail to see how [NSApp setApplicationIconImage:theNewImage]; is any different to [NSApp setApplicationIconImage:[theNewImage objectAtIndex:1]] but it obviously does function differently.

Mark

_______________________________________________

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: 
 >Re: Does [NSApp setApplicationIconImage] leak memory? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Custom URL Handling
  • Next by Date: Re: Custom URL Handling
  • Previous by thread: Re: Does [NSApp setApplicationIconImage] leak memory?
  • Next by thread: Re: Does [NSApp setApplicationIconImage] leak memory?
  • Index(es):
    • Date
    • Thread