Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!pasteur!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: DA questions, the second time around... Message-ID: <33466@ucbvax.BERKELEY.EDU> Date: 4 Jan 90 16:15:45 GMT References: <68060@tiger.oxy.edu> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 30 In article <68060@tiger.oxy.edu> sonenbli@oxy.edu (Andrew D. Sonenblick) writes: >I have many a DA which are utilities which must be loaded into the >application heap (so they can be assured of communication with the appl). >No biggie, option down on opening the DA. Ok, but I also *need* the >DA's to be closed upon quitting the applications they reside in. I, too, had this problem in the "Flips" desk accessory that is shipped in Scott Kim's "Letterforms & Illusions" product. This product has close to 100 paint files of Kim's beautiful calligraphic puzzle art, a demo version of MacPaint, and my desk accessory that adds new commands to macpaint for file traversal, and exploring symmetries of rotation and reflection. I solved the problem by installing a head patch on ExitToShell that, when triggered, attempts to remove my patches. (It may not be able to remove them, since thwey might have gotten re-patched by something else in the interim, and that something else will have cached away my procedure pointers as what it saw as the old value of the traps.) I patch through small "islands" in the system heap, so if it can't remove them, it can at least make them innocuous. I checked, applications _can_ exit via a return from main(), without directly calling ExitToShell(). But, if they try, the O.S. executes an ExitToShell() for them. "Letterforms & Illusions" is published by Scott Foresman & co. Check it out. --- David Phillip Oster -- No, I come from Boston. I just work Arpa: oster@dewey.soe.berkeley.edu -- in cyberspace. Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu