Re: Crash when using Command-Q
Re: Crash when using Command-Q
- Subject: Re: Crash when using Command-Q
- From: Ricky Sharp <email@hidden>
- Date: Wed, 02 Mar 2005 12:40:05 -0600
On Wednesday, March 02, 2005, at 12:33PM, Ricky Sharp <email@hidden> wrote:
>
>On Wednesday, March 02, 2005, at 12:24PM, John Stiles <email@hidden> wrote:
>
>>This looks like a double-release of some kind. Try turning on
>>NSZombieEnabled.
>>http://www.cocoadev.com/index.pl?NSZombieEnabled
>
>Thanks for the reminder about that flag. I do have that set up in my Xcode project but I was not running the app via Xcode earlier.
>
>Now that I'm not being braindead and running via Xcode once more, it is indeed a double-release problem. My IIContentWindow (subclass of NSWindow) is being released twice. But, only when invoking Command-Q to initiate the quit.
>
>The window is created programatically (i.e. doesn't live in a nib). At least now I can set breakpoints and know which entity to look at.
Thanks again John for that reminder. I was able to debug this in a snap.
Basically, the problem was that my window had its "release when closed" flag set to YES (this is default for all windows). And since I do not use any window controller for this window, that flag is not ignored. For some reason, invoking Command-Q ultimately sent a close message to my window.
Since I manually release my windows (content and blanking), I just set that flag to NO (using setReleasedWhenClosed:) in my window's init method. All is now well.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden