From 293e711739b7e6eb00497cce97f7cca87ba497a5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 12 Jul 2018 11:52:29 +0200 Subject: [PATCH] ProjectModel: Fix crash when updating parsing state of project Fix crash when updating the parsing state of a project during the time between the project being removed from the session and the time when the project is actually destroyed. Change-Id: I54bf4793626497315fe588ebb68474b880de2984 Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/projectmodels.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 226b85e67d0..cbb375da616 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -314,9 +314,15 @@ void FlatModel::handleProjectAdded(Project *project) QTC_ASSERT(project, return); connect(project, &Project::parsingStarted, - this, [this, project]() { parsingStateChanged(project); }); + this, [this, project]() { + if (nodeForProject(project)) + parsingStateChanged(project); + }); connect(project, &Project::parsingFinished, - this, [this, project]() { parsingStateChanged(project); }); + this, [this, project]() { + if (nodeForProject(project)) + parsingStateChanged(project); + }); addOrRebuildProjectModel(project); }