ClangTools: Avoid accessing deleted run worker

Change-Id: I74b977ede0d153ae4f8d85e03090dfc21facd04b
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-04-23 15:59:14 +02:00
parent bbed542ec3
commit d02f5664e5

View File

@@ -698,6 +698,7 @@ void ClangTool::startTool(ClangTool::FileSelection fileSelection,
connect(m_runWorker, &ClangToolRunWorker::started, this, &ClangTool::onStarted);
connect(m_runWorker, &ClangToolRunWorker::runnerFinished,
this, &ClangTool::updateForCurrentState);
connect(m_runControl, &RunControl::destroyed, [this](){ m_runWorker = nullptr; });
// More init and UI update
m_diagnosticFilterModel->setProject(project);
@@ -1038,6 +1039,8 @@ void ClangTool::onRunControlStopped()
void ClangTool::update()
{
updateForInitialState();
if (!m_runWorker)
return;
updateForCurrentState();
}