home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5258 < prev    next >
Encoding:
Internet Message Format  |  1992-07-27  |  1.4 KB

  1. Path: sparky!uunet!rosie!aozer
  2. From: aozer@next.com (Ali Ozer)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: Destroying Zones
  5. Message-ID: <4483@rosie.NeXT.COM>
  6. Date: 27 Jul 92 14:39:25 GMT
  7. References: <1992Jul27.010436.1749@kakwa.ucs.ualberta.ca>
  8. Sender: news@NeXT.COM
  9. Organization: Next Computer, Inc.
  10. Lines: 26
  11.  
  12. In article <1992Jul27.010436.1749@kakwa.ucs.ualberta.ca> Gary Ritchie writes:
  13. >I'm loading a nib file into its own zone, so that I can later destroy the  
  14. >zone and make everything go away.
  15.  
  16. It's just a bad idea to destroy a zone which contains kit objects. Some kit
  17. objects (including most of the interesting ones, such as Window, View, Font,
  18. NXImage, etc --- objects you might easily encounter in a .nib file)
  19. allocate resources or change some state.  Their -free method must be called to
  20. dispose of them properly. Also, even if you're sure that a kit object's free
  21. method doesn't do anything interesting, you are not guaranteed that this won't
  22. change in the next release.
  23.  
  24. There are cases where destroying zones to get rid of objects will work.
  25. If you have some simple object whose free simply frees itself or frees
  26. other similary simple objects, and your collection of objects are all in
  27. one zone, with no errant pointers into the zone and no unknown objects
  28. in the zone, then you can probably destroy the zone to get rid of the objects,
  29. avoiding many calls to free().
  30.  
  31. Ali, Ali_Ozer@NeXT.com
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.