summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-08-08 15:27:15 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-08-08 14:12:38 +0000
commitc392d3ee13ae54f37a3b7ae2c94cc63b17092f3d (patch)
tree210c8c47154564b9e39cc1152f5f25b402adc7d2
parentff9e55d5fb1867a9aff74673d8a08d0cba2cb900 (diff)
downloadqt-creator-c392d3ee13ae54f37a3b7ae2c94cc63b17092f3d.tar.gz
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: hjk <hjk@qt.io>
-rw-r--r--src/plugins/projectexplorer/runconfiguration.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index e1563957d6..bf3d1346d1 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -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) {