Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Installing CODE as aVBL -- PART 2 Message-ID: <7461@hoptoad.uucp> Date: 26 May 89 19:17:41 GMT References: <5595@hubcap.clemson.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 35 In article: Michael writes: >Anyway, why would the machine crash if the installing program exits before the >VBL task comes up to go? I tried allocating my VBLTask record as a handle >and locking it in case the fact that it got disposed of was the problem, but >this didn't help. In article ksitze@nmsu.edu (Kevin Sitze) writes: >Read this again. Your problem lies in the fact that your exiting your >program before dequeueing the VBL task. In other words, your entire >application heap has suddenly gone to vapor-land and since the VBL >manager is trying to run a task in this invalid region of memory, >where there no longer is a task, the machine decides to upchuck it's >problems directly to the user. Sorry, no. One of the many things that happens as a result of ExitToShell or (exec-type) Launch is that all VBL tasks in the caller's application heap are dequeued. There's no more need to dequeue your own VBLs than there is to close your own resource files. >The answer to your problem is to allocate the resource into the system >heap. Go into ResEdit and enable the 'allocate in system heap' >(?InSysZone?)flag for that resource. You shouldn't have any problem >from there. Only if you want it to run forever. Most application-launched VBLs should want to stop running when the application does. -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "Do what you wanna, do what you will; Just don't mess up your neighbor's thrill. And when you pay the bill, kindly leave a little tip To help the next poor sucker on his one-way trip." - Frank Zappa, "You Are What You Is"