forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user