Commit c392d3ee authored by Ulf Hermann's avatar Ulf Hermann

ProjectExplorer: Kill dependent RunWorkers if dependencies go away

There is no point in e.g. keeping the QML profiler RunWorker going if
the process has spontaneously stopped.

Change-Id: Ifdae17231cb193fd220397fa0739a74871ceeab3
Reviewed-by: default avatarhjk <hjk@qt.io>
parent ff9e55d5
......@@ -961,6 +961,22 @@ void RunControlPrivate::onWorkerStopped(RunWorker *worker)
return;
}
for (RunWorker *dependent : worker->d->stopDependencies) {
switch (dependent->d->state) {
case RunWorkerState::Done:
case RunWorkerState::Failed:
break;
case RunWorkerState::Initialized:
dependent->d->state = RunWorkerState::Done;
break;
default:
debugMessage("Killing " + dependent->d->id + " as it depends on stopped " + workerId);
dependent->d->state = RunWorkerState::Stopping;
QTimer::singleShot(0, dependent, &RunWorker::initiateStop);
break;
}
}
debugMessage("Checking whether all stopped");
bool allDone = true;
for (RunWorker *worker : m_workers) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment