Re: The release of NSWindowController
Re: The release of NSWindowController
- Subject: Re: The release of NSWindowController
- From: j o a r <email@hidden>
- Date: Sun, 13 Apr 2003 20:45:49 +0200
On Sunday, Apr 13, 2003, at 20:12 Europe/Stockholm, Tony S. Wu wrote:
So, I catch the windowWillClose notification then make the window
controller autorelease.
<snip>
I kinda expected it to become invalid after release...
Did you check after _release_ or after _autorelease_? If you
autorelease the window controller it will not be released until at the
end of the current event loop (in the typical case). In other words, if
you autorelease it and in the same event loop check if it's valid it
would be - but if you as a respons to a subsequent event try to access
it, it would be released.
Still, if you autorelease it - how comes you still hold a reference to
it that you can use to send messages to it? You shoud nil out or
replace any variable that holds a pointer to the released window
controller.
j o a r
_______________________________________________
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.