Inability to close Firefox

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Inability to close Firefox

Post by SteveTX » Sat Jun 18, 2011 9:00 am

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?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Inability to close Firefox

Post by Mark » Sun Jun 19, 2011 11:15 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 264
Joined: Mon May 18, 2009 4:12 am

Re: Inability to close Firefox

Post by wsamples » Sun Jun 19, 2011 5:44 pm

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 :D 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.

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 264
Joined: Mon May 18, 2009 4:12 am

Re: Inability to close Firefox

Post by wsamples » Sun Jun 19, 2011 9:43 pm

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.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Inability to close Firefox

Post by Mark » Sun Jun 19, 2011 9:49 pm

wsamples (since i don't know your name) your link is for Unix, not Windows. Got a Windows source?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 264
Joined: Mon May 18, 2009 4:12 am

Re: Inability to close Firefox

Post by wsamples » Sun Jun 19, 2011 11:09 pm

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

Post Reply