* @brief Terminates every managed process (terminate, then kill on grace-period timeout). */
| 230 | * @brief Terminates every managed process (terminate, then kill on grace-period timeout). |
| 231 | */ |
| 232 | void API::ProcessLauncher::killAll() |
| 233 | { |
| 234 | const auto processes = m_processes; |
| 235 | m_processes.clear(); |
| 236 | |
| 237 | for (auto* process : processes) { |
| 238 | if (!process) |
| 239 | continue; |
| 240 | |
| 241 | process->terminate(); |
| 242 | if (!process->waitForFinished(kTerminateGraceMs)) |
| 243 | process->kill(); |
| 244 | |
| 245 | process->deleteLater(); |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * @brief Returns the id, program, and arguments of every running managed process. |