mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-27 09:13:09 +00:00
runner: shutdown spawned runnerd QProcess reliably
This commit is contained in:
parent
ca19e21661
commit
05ca3de5f5
1 changed files with 13 additions and 5 deletions
|
|
@ -152,15 +152,23 @@ void RunnerManagerClient::shutdownSpawnedRunnerDaemon()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_runnerdProcess->state() == QProcess::NotRunning) {
|
QProcess *p = m_runnerdProcess;
|
||||||
|
const auto state = p->state();
|
||||||
|
if (state == QProcess::NotRunning) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_runnerdProcess->terminate();
|
// Avoid our finished() handler nulling the pointer while we're shutting down.
|
||||||
if (!m_runnerdProcess->waitForFinished(1000)) {
|
p->disconnect(this);
|
||||||
m_runnerdProcess->kill();
|
|
||||||
m_runnerdProcess->waitForFinished(1000);
|
p->terminate();
|
||||||
|
if (!p->waitForFinished(3000)) {
|
||||||
|
p->kill();
|
||||||
|
p->waitForFinished(3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p->deleteLater();
|
||||||
|
m_runnerdProcess = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunnerManagerClient::ensureRunnerDaemon()
|
void RunnerManagerClient::ensureRunnerDaemon()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue