Page 1 of 1

LiveCode Zombie Processes

Posted: Wed Jul 02, 2014 1:14 pm
by WaltBrown
I am having an issue that when I quit LC, the application quits but the LC process stays active (as reported by the Windows Task Manager). The next time I attempt to open LC, a second zombie LC process appears but not the application. I have to go into Task Manager, end the LC processes manually, then I can restart LC. Has anyone else seen this? I am not certain it is pilot error but might be :-)
Thanks!

Re: LiveCode Zombie Processes

Posted: Wed Jul 02, 2014 2:21 pm
by magice
That usually happens when you have a message pending when LC closes. see pendingMessages in the dictionary

Re: LiveCode Zombie Processes

Posted: Wed Jul 02, 2014 4:35 pm
by [-hh]
..........

Re: LiveCode Zombie Processes

Posted: Wed Jul 02, 2014 6:59 pm
by jacque
LC will not quit until all open processes are closed or completed. This includes pending messages, but also any open drivers (revSpeak, for example, opens a driver,) or any open sockets (libURL calls, or sockets you have opened in a script) or any handlers that have not yet finished executing. The stack should have a shutdown handler that closes everything it's opened and removes all pending messages from the queue.

Re: LiveCode Zombie Processes

Posted: Wed Jul 02, 2014 9:39 pm
by WaltBrown
Thanks. It happens even if I don't do anything, so it may be the annoying, always pending LC toolbar message "There is an updated version". That happens very frequently, as I (and I imagine others) use various versions on the same machine. I turned off all the "Notify me" boxes in Edit->Preferences->Updates and will see what happens.

Re: LiveCode Zombie Processes

Posted: Sat Jul 05, 2014 11:27 am
by Mark
Hi Walt,

After I install a new version of LiveCode, I change the name of .setup.exe to _setup.exe. This prevents the updater from starting and keeps zombie processes away.

Obviously, this doesn't apply to standalones. For standalones, you need to make sure that everything finishes before quitting the app. You can do this with a script like this:

Code: Select all

on quitMyProject
   lock messages
   -- stop using stacks
   put the stacksInUse into myStacks
   repeat for each line myStack in myStacks
      stop using stack myStack
   end repeat
   -- stacks
   put the openStacks into myStacks
   put "message box,home,tool,Message Box,revTools,revMenubar" & comma & the short name of me into myDontClose
   repeat for each line myStack in myStacks
      if myStack is not among the items of myDontClose then close stack myStack
   end repeat
   -- messages
   put the pendingmessages into myMsgs
   repeat for each line myMsg in myMsgs
      cancel item 1 of myMsg
   end repeat
   set the backdrop to none
   // close me
   if the environment is not "development" then
      quit
   end if
end quitMyProject
Kind regards,

Mark

Re: LiveCode Zombie Processes

Posted: Sat Jul 12, 2014 1:21 am
by WaltBrown
Good idea, Mark, thanks, I hadn't thought of that.
Walt