home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.programmer
- Path: sparky!uunet!psgrain!hippo!shannon!pc86.ee.wits.ac.za!colo
- From: colo@odie.ee.wits.ac.za (Illan Colombick)
- Subject: Re: freeing an object--when?
- Message-ID: <colo.21@odie.ee.wits.ac.za>
- Sender: news@shannon.ee.wits.ac.za
- Organization: Wits Electrical Engineering (Novell Users).
- References: <1992Jul24.180535.18214@MITL.COM>
- Distribution: na
- Date: Sun, 26 Jul 1992 13:18:41 GMT
- Lines: 41
-
- In article <1992Jul24.180535.18214@MITL.COM> edlau@mitl.com (Ed Lau) writes:
-
-
-
- >Here's my problem: I want to free my document object when the user closes its
- >respective window. To do this, I have the following code in my windowWillClose:
- >method in Document.m:
-
- >- windowWillClose:sender
- >{
- > [controller rmDoc:self];
-
- > ...
- >}
-
- [stuff deleted]
-
- >However, since my document object is freed, its window is left without a
- >delegate. What to do?
-
- >--Edward Lau
- >edlau@chaos.mitl.com
-
- Surely it does not matter that the window is without a delegate? The Window
- is about to close. Unless you have setFreeOnClose: NO (default is YES), so
- that the window just disappears from the screen, but remains in existence.
- In that case, have windowWillClose check the dontFreeOnClose value to
- decide whether or not to free the Document.
-
- If I have missed something here about doomed delegateless windows, please do
- tell me, I am (very) far from being an expert NeXT programmer.
-
- Bye.
- Illan
-
- ......
- \\\\\///
- C o l o {textmail, NeXTmail} to colo@{odie, TuRInG}.ee.wits.ac.za
- %% - %
- ~%%%~
-
-