Re: Closing vs quitting documents
Re: Closing vs quitting documents
- Subject: Re: Closing vs quitting documents
- From: Serge Meynard <email@hidden>
- Date: Tue, 29 Mar 2005 10:00:51 -0500
On Mar 29, 2005, at 09:27, Ricky Sharp wrote:
On Tuesday, March 29, 2005, at 07:50AM, Serge Meynard
<email@hidden> wrote:
Can someone provide a better understanding of what's going on when I
quit? Why are the overlay windows being released one too many times by
the framework? Why is dealloc not being called systematically? I can
imagine ways of working around this, by moving the code out of the
dealloc and checking if the app is quitting or not, but I would hate
to
go there without even knowing what the cause is. Any help would be
appreciated.
See the docs on NSWindow's setReleasedWhenClosed:. Since it sounds
like you're manually managing your overlay windows (i.e. not managing
them with a window controller), send them a setReleasedWhenClosed
message with a parameter of NO upon their creation. The framework
will then not send them an additional release message when they
receive a close message.
Doh! That call stack makes complete sense now that you mention that.
I've never had to worry about that flag until now, so I never thought
about it. Crash fixed, thanks! (And shed a tear for all the hair I
uselessly lost over this :)
Now I'm only left wondering... When I quit with a secondary window
open, why is it only the main window's custom view gets a dealloc? Why
do I get no dealloc calls at all if only the main window is open? I
know it's no big deal since it won't be leaking for very long, but why
the inconsistent behavior?
Serge
_______________________________________________
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