| 68 | } |
| 69 | |
| 70 | void Process::terminate() |
| 71 | { |
| 72 | if (state() != QProcess::NotRunning) { |
| 73 | #ifdef Q_OS_WIN |
| 74 | if (IsWindows8OrGreater()) { |
| 75 | TerminateJobObject(jobObject, EXIT_FAILURE); |
| 76 | } else { |
| 77 | // We can't use job objects in Windows 7, since MiniZinc already uses them |
| 78 | QProcess::kill(); |
| 79 | } |
| 80 | #else |
| 81 | ::killpg(processId(), SIGKILL); |
| 82 | #endif |
| 83 | if (!waitForFinished(500)) { |
| 84 | kill(); |
| 85 | waitForFinished(); |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | void Process::sendInterrupt() |
| 91 | { |
no test coverage detected