summaryrefslogtreecommitdiff
path: root/src/spawn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/spawn.cpp')
-rw-r--r--src/spawn.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/spawn.cpp b/src/spawn.cpp
index 8cc5abe1..ddcf573e 100644
--- a/src/spawn.cpp
+++ b/src/spawn.cpp
@@ -117,10 +117,17 @@ HANDLE startBinary(const QFileInfo &binary,
HANDLE stdOut,
HANDLE stdErr)
{
+ JOBOBJECT_EXTENDED_LIMIT_INFORMATION jobInfo;
+
+ ::QueryInformationJobObject(NULL, JobObjectExtendedLimitInformation, &jobInfo, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION), NULL);
+ jobInfo.BasicLimitInformation.LimitFlags |= JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK | JOB_OBJECT_LIMIT_BREAKAWAY_OK;
+
HANDLE jobObject = ::CreateJobObject(NULL, NULL);
if (jobObject == NULL) {
qWarning("failed to create job object: %lu", ::GetLastError());
+ } else {
+ ::SetInformationJobObject(jobObject, JobObjectExtendedLimitInformation, &jobInfo, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION));
}
HANDLE processHandle, threadHandle;
@@ -193,19 +200,3 @@ HANDLE startBinary(const QFileInfo &binary,
::CloseHandle(threadHandle);
return jobObject;
}
-
-/*
-ExitProxy *ExitProxy::s_Instance = NULL;
-
-ExitProxy *ExitProxy::instance()
-{
- if (s_Instance == NULL) {
- s_Instance = new ExitProxy();
- }
- return s_Instance;
-}
-
-void ExitProxy::emitExit()
-{
- emit exit();
-}*/