forked from qt-creator/qt-creator
Qbs: Fix memory leak in Qbs Project Manager
Make sure the root node of the project tree is actually deleted. Change-Id: Idf32460d7b5d0518da9536084cccb074638cfce3 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -114,6 +114,8 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
|
||||
connect(&m_parsingDelay, SIGNAL(timeout()), this, SLOT(parseCurrentBuildConfiguration()));
|
||||
|
||||
updateDocuments(QSet<QString>() << fileName);
|
||||
|
||||
// NOTE: QbsProjectNode does not use this as a parent!
|
||||
m_rootProjectNode = new QbsProjectNode(this); // needs documents to be initialized!
|
||||
}
|
||||
|
||||
@@ -125,6 +127,12 @@ QbsProject::~QbsProject()
|
||||
m_qbsSetupProjectJob->cancel();
|
||||
delete m_qbsSetupProjectJob;
|
||||
}
|
||||
|
||||
// Deleting the root node triggers a few things, make sure rootProjectNode
|
||||
// returns 0 already
|
||||
QbsProjectNode *root = m_rootProjectNode;
|
||||
m_rootProjectNode = 0;
|
||||
delete root;
|
||||
}
|
||||
|
||||
QString QbsProject::displayName() const
|
||||
|
||||
Reference in New Issue
Block a user