Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!kuhub.cc.ukans.edu!2fmlcalls From: 2fmlcalls@kuhub.cc.ukans.edu Newsgroups: comp.sys.mac.programmer Subject: Re: Correctly ending a program? Message-ID: <1991Apr29.192651.30184@kuhub.cc.ukans.edu> Date: 29 Apr 91 19:26:51 CDT References: <042891.202915BRBOYER@MTUS5.CTS.MTU.EDU> <12838@pt.cs.cmu.edu> Organization: University of Kansas Academic Computing Services Lines: 26 In article <12838@pt.cs.cmu.edu>, hairston@henry.ece.cmu.edu (David Hairston) writes: > [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 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 Although not too common for most programs, one pitfall I've encountered was forgetting to dispose of sound channels my program had created. This will cause after-the-exit crashes. john calhoun