>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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to