mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-26 17:03:08 +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;
|
||||
}
|
||||
|
||||
if (m_runnerdProcess->state() == QProcess::NotRunning) {
|
||||
QProcess *p = m_runnerdProcess;
|
||||
const auto state = p->state();
|
||||
if (state == QProcess::NotRunning) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_runnerdProcess->terminate();
|
||||
if (!m_runnerdProcess->waitForFinished(1000)) {
|
||||
m_runnerdProcess->kill();
|
||||
m_runnerdProcess->waitForFinished(1000);
|
||||
// Avoid our finished() handler nulling the pointer while we're shutting down.
|
||||
p->disconnect(this);
|
||||
|
||||
p->terminate();
|
||||
if (!p->waitForFinished(3000)) {
|
||||
p->kill();
|
||||
p->waitForFinished(3000);
|
||||
}
|
||||
|
||||
p->deleteLater();
|
||||
m_runnerdProcess = nullptr;
|
||||
}
|
||||
|
||||
void RunnerManagerClient::ensureRunnerDaemon()
|
||||
|
|
|
|||
Loading…
Reference in a new issue