Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!pt.cs.cmu.edu!henry.ece.cmu.edu!hairston From: hairston@henry.ece.cmu.edu (David Hairston) Newsgroups: comp.sys.mac.programmer Subject: Re: Correctly ending a program? Message-ID: <12838@pt.cs.cmu.edu> Date: 29 Apr 91 17:03:46 GMT References: <042891.202915BRBOYER@MTUS5.CTS.MTU.EDU> Organization: Gaia II Lines: 24 [BRBOYER@MTUS5.CTS.MTU.EDU (Rucell) writes:] [] When a program is "Quit" out of, what happens to all memory that the [] program aloocated? Should I close all my windows? Should I dispose of all [] pointers and handles, or does the memory manager close out everything for [] me? [] [] I have been experiencing intermittent bombing while in and out of my [] program. What is recommended? the memory manager clears your application heap when you Quit. however, you don't want the memory manager governing your interface so at the least undo the things you've done (i.e. close windows, etc. in a logical manner). the intermittent bombs (what error number?) are most likely caused by incorrectly using handles and pointers. if you have MacsBug (or some debugger) installed then activate "Heap Scramble" (hs in MacSBug) or its equivalent (something that forces memory to move on memory management calls) so that you can uncover this type of bug. heap scramble slows down your application execution but that's a small price to pay ... -dave- hairston@henry.ece.cmu.edu