|
From: | Richard Frith-Macdonald |
Subject: | Re: NSWorkspace -launchedApplications does not track crashed applications |
Date: | Tue, 13 Mar 2007 07:41:31 +0000 |
On 13 Mar 2007, at 05:46, Yen-Ju Chen wrote:
I notice that if an application terminates abnormally, NSWorkspace won't know it and -laucnhedApplications still return that application. The only way I can think about of tracking crashed application is to use NSConnection to it, but I guess it is less efficient. It is very easy to test. Just start an application from command line and use Ctrl-C to terminate it. NSWorkspace still think it is running. Any suggestion ?
That's a documented feature ... the values in -launchedApplications are not guaranteed to be up to date.
We can't use NSConnection to tell if an app is alive, because an app launched by NSWorkspace could be something which isn't a GNUstep application (many app wrappers exist for things like mozilla and gimp).
Solutions *are* possible ... the only really reliable and portable one I can think of would be to change our app wrappers to use a tiny tool to run the unix/windows native app as a subtask and monitor the subtask.
[Prev in Thread] | Current Thread | [Next in Thread] |