forked from qt-creator/qt-creator
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 <eike.ziller@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -290,7 +290,7 @@ public:
|
|||||||
void checkState(RunControlState expectedState);
|
void checkState(RunControlState expectedState);
|
||||||
void setState(RunControlState state);
|
void setState(RunControlState state);
|
||||||
|
|
||||||
void debugMessage(const QString &msg);
|
void debugMessage(const QString &msg) const;
|
||||||
|
|
||||||
void initiateStart();
|
void initiateStart();
|
||||||
void initiateReStart();
|
void initiateReStart();
|
||||||
@@ -1039,6 +1039,10 @@ bool RunControl::supportsReRunning() const
|
|||||||
bool RunControlPrivate::supportsReRunning() const
|
bool RunControlPrivate::supportsReRunning() const
|
||||||
{
|
{
|
||||||
for (RunWorker *worker : m_workers) {
|
for (RunWorker *worker : m_workers) {
|
||||||
|
if (!worker) {
|
||||||
|
debugMessage("Found unknown deleted worker when checking for re-run support");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!worker->d->supportsReRunning)
|
if (!worker->d->supportsReRunning)
|
||||||
return false;
|
return false;
|
||||||
if (worker->d->state != RunWorkerState::Done)
|
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;
|
qCDebug(statesLog()) << msg;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user