Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!decwrl!claris!outpost.UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.programmer Subject: Re: Correctly ending a program? Message-ID: <0B010004.46jzbg@outpost.UUCP> Date: 29 Apr 91 04:27:18 GMT Reply-To: peirce@outpost.UUCP Organization: Peirce Software Lines: 28 X-Mailer: uAccess - Mac Release: 1.0.3 In article <042891.202915BRBOYER@MTUS5.CTS.MTU.EDU>, 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 goes back to the system and can be allocated to another program later. With things like handle data and such you needn't explicitly deallocate these things if you are quiting. On the other hand, there *are* some things that should be explicitly deallocated. Anything that is linked into system structures needs to get unlinked. For example, if you register an NBP name in AppleTalk, that block of memory becomes the properly of AppleTalk and the name must be unregistered before exiting. -- michael -- Michael Peirce -- outpost!peirce@claris.com -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- & Consulting -- (408) 244-6554, AppleLink: PEIRCE