QbsProjectManager: Delete ProjectDocuments along with project

The documents have a reload callback that accesses the project. This
would lead to a crash on a reload for a document belonging to a closed
project.

Change-Id: I171cacd0da347fb279609baaea4050ba1cc12008
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Christian Kandeler
2017-06-13 16:43:12 +02:00
parent 784f807c1b
commit b5c8428285

View File

@@ -158,6 +158,8 @@ QbsProject::~QbsProject()
m_qbsUpdateFutureInterface = 0;
}
qDeleteAll(m_extraCompilers);
std::for_each(m_qbsDocuments.cbegin(), m_qbsDocuments.cend(),
[](Core::IDocument *doc) { doc->deleteLater(); });
}
QbsRootProjectNode *QbsProject::rootProjectNode() const