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