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 <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2018-07-12 11:52:29 +02:00
parent e6cfe06dfc
commit 293e711739

View File

@@ -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);
}