summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.cpp4
-rw-r--r--process.cpp6
2 files changed, 4 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index dd5ce1e..3fa2a14 100644
--- a/main.cpp
+++ b/main.cpp
@@ -230,8 +230,6 @@ int main(int argc, char **argv)
return 1;
}
- ::setpgid(0,0); // must be called before setsid()
- ::setsid();
Config config = parseConfigFile();
while (!args.isEmpty()) {
@@ -249,6 +247,8 @@ int main(int argc, char **argv)
}
} else if (arg == "--debug-gdb") {
useGDB = true;
+ setpgid(0,0); // must be called before setsid()
+ setsid();
} else if (arg == "--debug-qml") {
useQML = true;
} else if (arg == "--stop") {
diff --git a/process.cpp b/process.cpp
index 31e28bd..b7e7342 100644
--- a/process.cpp
+++ b/process.cpp
@@ -222,14 +222,12 @@ void Process::stop()
if (kill(mDebuggee, SIGKILL) != 0)
perror("Could not kill debugee");
}
+ if (kill(-getpid(), SIGTERM) != 0)
+ perror("Could not kill process group");
mProcess->terminate();
if (!mProcess->waitForFinished())
mProcess->kill();
-
- // Just for completeness terminate the whole group
- // in case the application has started subprocesses
- ::kill(-getpid(), SIGTERM);
}
void Process::incomingConnection(int i)