home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5298 < prev    next >
Encoding:
Text File  |  1992-07-28  |  1.7 KB  |  39 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!wupost!gumby!destroyer!caen!nic.umass.edu!amherst!amherst.edu!mkrogers
  3. From: mkrogers@amherst.edu
  4. Subject: Re: freeing an object--when?
  5. Message-ID: <1992Jul28.153114.1@amherst.edu>
  6. Lines: 25
  7. Sender: usenet@amhux2.amherst.edu (USENET News System)
  8. Nntp-Posting-Host: amh.amherst.edu
  9. Organization: Amherst College, Amherst Mass.
  10. References: <1992Jul24.180535.18214@MITL.COM> <colo.21@odie.ee.wits.ac.za>
  11. Distribution: na
  12. Date: Tue, 28 Jul 1992 19:31:14 GMT
  13.  
  14. In article <colo.21@odie.ee.wits.ac.za>, colo@odie.ee.wits.ac.za (Illan Colombick) writes:
  15. > In article <1992Jul24.180535.18214@MITL.COM> edlau@mitl.com (Ed Lau) writes:
  16. > [stuff deleted]
  17. >>However, since my document object is freed, its window is left without a  
  18. >>delegate. What to do?
  19. > Surely it does not matter that the window is without a delegate? The Window 
  20. > is about to close. Unless you have setFreeOnClose: NO (default is YES), so 
  21. > that the window just disappears from the screen, but remains in existence. 
  22. > In that case, have windowWillClose check  the dontFreeOnClose value to 
  23. > decide whether or not to free the Document. 
  24.  
  25. There might be a problem if the window thinks that the freed object is
  26. still its delegate and tries to send it a message.  I would guess that
  27. after the windowWillClose: method returns the window is done with
  28. its delegate.  If you want to be on the safe side you could set
  29. the window's delegate to nil in windowWillClose:, or use
  30.     [NXApp delayedFree:self];
  31. in the windowWillClose: method to free your document.  The document
  32. will be freed just before NXApp tries to get the next event.
  33.  
  34.     -mike
  35.     mkr@cs.amherst.edu
  36.