Re: WindowController never released
Re: WindowController never released
- Subject: Re: WindowController never released
- From: Jeff Gilbert <email@hidden>
- Date: Wed, 14 Aug 2002 18:30:04 -0500
Yes, I release the windowController after I add it to the document. My
code looks something like this:
- (void)makeWindowControllers
{
MyWindowController* windowController = [[MyWindowController
allocWithZone:[self zone]] init];
[self addWindowController:windowController];
[windowController release];
}
later,
Jeff Gilbert
On Wednesday, August 14, 2002, at 05:45 PM, Gerben Wierda wrote:
I have subclassed NSWindowController and NSDocument. In NSDocument I
have added the makeWindowControllers entry following the instructions
in the docs:
- (void)makeWindowControllers {
II2WindowController *myController = [[II2WindowController
allocWithZone:[self zone]] initWithWindowNibName:@"II2Package"];
[self addWindowController:myController];
}
But both these retain myController. As a result, when I close the
window, my windowcontroller is never dealloced (and thus some object
housekeeping never took place). So, this seems wrong as it does not
follow the 'closing behaviour' as per the docs.
Shall I just release myDocument in makeWindowControllers?
G
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.