I’m finding that File::startAsProcess() has a tendency to hang on linux. It doesn’t happen all the time, but when it does, the whole app hangs, and the app I’m trying to run doesn’t show until I force quit the hanging app.
For now I’ve got around it by using the following code (I think I got it from the windowlab source):
[code] pid_t pid = fork();
switch (pid)
{
case 0: //Child process - successful.
setsid();
execlp("/bin/sh", "sh", "-c", (char*) (const char*) cmdString, NULL);
//Only get to this point if execlp didn't work.
exit(1);
break;
case -1: //Parent process - unsuccessful.
return false;
break;
default: //Parent process - successful.
break;
}[/code]
But I’m not sure if it’s a complete replacement for the current JUCE code…
Okay, as far as I can tell (the debugger was acting up a bit), it does seem to be the waitpid call that’s causing the problem. Don’t know if that’s any help though.