home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 13893 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.4 KB  |  42 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!decwrl!adobe!jryan@adobe.com
  3. From: jryan@adobe.com (Jim Ryan)
  4. Subject: m e m o r y m a n a g e m e n t
  5. Message-ID: <1992Aug12.192637.13847@adobe.com>
  6. Sender: usenet@adobe.com (USENET NEWS)
  7. Organization: Adobe Systems, Inc.
  8. Date: Wed, 12 Aug 1992 19:26:37 GMT
  9. Lines: 31
  10.  
  11. I'm a tad cloudy on when/where the "Dispos(e)" routines need to be used
  12. to clean up memory.  
  13.  
  14. 1.  For example, let's say I have a dialog that has
  15. a bunch of controls, TEs, picts, etc.  Is it enough to simply use
  16. DisposeDialog when I'm through with it?  What advantage/disadvantage
  17. is there in passing nil to NewDialog for storage.  If it's bad, as IM says
  18. it is as it will fragment the heap, should one use DisposPtr to toss
  19. the storage *as-well-as* DisposeDialog?
  20.  
  21. 2.  Say I have a C function that has some local variables like:
  22. Handle theHandle;
  23. TEHandle theTE;
  24. Ptr        thePtr;
  25.  
  26. I guess what I'm not entirely sure of is, when does one need to dispose
  27. of such variables, and when will they die with the termination of the 
  28. function?
  29.  
  30. 3.  Resources... when do you dispose of them, release them, etc.
  31.  
  32. 4.     Any other memory issues I've missed and/or should be aware of?
  33.  
  34. The memory management section of IM is a bit vague about this subject; are
  35. there technotes, or other documentation, that are more complete?
  36.  
  37. Any help/hints about this subject would be greatly appreciated.
  38.  
  39. Thanks, 
  40. jr
  41.  
  42.