• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: The release of NSWindowController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >The release of NSWindowController (From: "Tony S. Wu" <email@hidden>)

  • Prev by Date: Re: 10.2.5 problem
  • Next by Date: selecting/disabling images
  • Previous by thread: The release of NSWindowController
  • Next by thread: selecting/disabling images
  • Index(es):
    • Date
    • Thread