Page 1 of 1
Inability to close Firefox
Posted: Sat Jun 18, 2011 9:00 am
by SteveTX
I have opened firefox with "open process firefox.exe as neither"
Attempts to shut down firefox using close process fail. Infact, I have a loop that reads all open processes and sends close process commands until openProcesses is empty. This loop continues forever for runrev opened firefox processes. In my previous dealings with firefox, I have found that firefox spawns subprocesses which then assume the main tree when firefox terminates unexpectedly. This is a behavior of firefox to avoid hard crashes.
This leads me to believe that firefox is either not properly receiving the SIGTERM signal from "close process", or is ignoring it. Any thoughts?
Re: Inability to close Firefox
Posted: Sun Jun 19, 2011 11:15 am
by Mark
Hi,
If there are subprocesses, then you'll have to find out which processes they are and kill them all in the right order.
It is the operating system and not FireFox that decides whether or not to kill the process. FireFox can't stop itself from being killed.
The close process command often doesn't work properly. You mght want to use the kill command or the taskkill DOS command (the latter is unavailable on anything lower than Win XP Pro).
Kind regards,
Mark
Re: Inability to close Firefox
Posted: Sun Jun 19, 2011 5:44 pm
by wsamples
In my experience, "close process" does not appear to quit gui applications opened with "open process", in Linux. Application window is still open and the process is still visible in system monitor. It is also necessary to use the close process command, even when the app in question has been closed some other way, in order to invoke "open process" with the same app again. Neither behavior is suggested by the dictionary entries.
-- EDIT --
Ok, the need to use "close process" before invoking "open process" with the same appName again, under the scenario referred to, might be considered "suggested" by the dictionary once the problem is discovered, but that it must be explicitly called in this case, even though the process is clearly not open, is decidedly unintuitive

Something else to watch out for if one is using "open process" as a substitute for "launch" with gui applications.
additional edit-- Experimentation suggests the need to use close process as stated above may be a Linux issue. It doesn't seem to be happening in Windows 7.
Re: Inability to close Firefox
Posted: Sun Jun 19, 2011 9:43 pm
by wsamples
I would be curious to learn what signal is sent on "close process". If an ordinary (polite) TERM closes these processes, why doesn't close process work? I suppose it would be interesting to have this information for all platforms
Mark, programmers can and do provide shutdown routines which respond variously to an ordinary kill command, which is typically the same as SIGTERM.
Here's a really concise explanation.
Re: Inability to close Firefox
Posted: Sun Jun 19, 2011 9:49 pm
by Mark
wsamples (since i don't know your name) your link is for Unix, not Windows. Got a Windows source?
Mark
Re: Inability to close Firefox
Posted: Sun Jun 19, 2011 11:09 pm
by wsamples
No, Mark, and I couldn't argue the point specifically regarding Windows

I also understand that Windows is the operating system Steve is using. However, your statement had something of a generic tone, and Livecode is cross-platform... I don't mean to be throwing darts at you, or anyone, but a little clarification shouldn't hurt, no?
Cheers
Warren