Re: Does [NSApp setApplicationIconImage] leak memory?
Re: Does [NSApp setApplicationIconImage] leak memory?
- Subject: Re: Does [NSApp setApplicationIconImage] leak memory?
- From: "Kyle Sluder" <email@hidden>
- Date: Sun, 10 Aug 2008 19:37:47 -0400
On Fri, Aug 8, 2008 at 9:02 AM, Matt Neuburg <email@hidden> wrote:
> Wrap each call to setApplicationIconImage in an autorelease pool creation
> and release, like this:
>
> NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
> [NSApp setApplicationIconImage: whatever];
> [pool release];
Okay, sorry for jumping in late, but I don't understand how this would
solve the problem. Since we're talking about NSApplication, AppKit
has already created an NSAutoreleasePool, so it's not like
-setApplicationIconImage: is autoreleasing an object when there's no
autorelease pool stack. Therefore, regardless of whether it's an
AppKit autorelease pool or your own autorelease pool, any autoreleased
object will still only get one -release message. Creating your own
autorelease pool should only make it happen "now" instead of "later".
--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