From 72cdbbb8dac8f5b7aec82af294459e1f47692ce2 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 20 Nov 2023 18:14:49 +0100 Subject: [PATCH] ProjectExplorer: Check for accidentally deleted workers ... before checking for re-run support. The workers are own by the RunControl, they should not self-destruct, but this apparently happens. Change-Id: I41101dfc20bf2ff4f19c440934e4d4010a88c04e Reviewed-by: Eike Ziller Reviewed-by: Tim Jenssen Reviewed-by: --- src/plugins/projectexplorer/runcontrol.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 8eb6f5e6ba0..76eed5c5c2c 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -290,7 +290,7 @@ public: void checkState(RunControlState expectedState); void setState(RunControlState state); - void debugMessage(const QString &msg); + void debugMessage(const QString &msg) const; void initiateStart(); void initiateReStart(); @@ -1039,6 +1039,10 @@ bool RunControl::supportsReRunning() const bool RunControlPrivate::supportsReRunning() const { for (RunWorker *worker : m_workers) { + if (!worker) { + debugMessage("Found unknown deleted worker when checking for re-run support"); + return false; + } if (!worker->d->supportsReRunning) return false; if (worker->d->state != RunWorkerState::Done) @@ -1183,7 +1187,7 @@ void RunControlPrivate::setState(RunControlState newState) } } -void RunControlPrivate::debugMessage(const QString &msg) +void RunControlPrivate::debugMessage(const QString &msg) const { qCDebug(statesLog()) << msg; }