Commit 1a2f649b authored by Tobias Hunger's avatar Tobias Hunger

CMake: Clean out unnecessary data in server mode reader

Do not keep data around once it is used. It will not help on the next run,
especially not when the parsing fails then:-)

Change-Id: Ifa1259b74349ac172a5c9d5411c10d429085b853
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent ae46c06a
......@@ -219,6 +219,7 @@ void ServerModeReader::generateProjectTree(CMakeProjectNode *root, const QList<F
knownFiles.insert((*it)->filePath());
QList<FileNode *> fileGroupNodes = m_cmakeInputsFileNodes;
m_cmakeInputsFileNodes.clear(); // Clean out, they are not going to be used anymore!
foreach (const FileGroup *fg, m_fileGroups) {
for (const FileName &s : fg->sources) {
const int oldCount = knownFiles.count();
......@@ -251,6 +252,12 @@ QSet<Core::Id> ServerModeReader::updateCodeModel(CppTools::ProjectPartBuilder &p
languages.unite(QSet<Core::Id>::fromList(ppBuilder.createProjectPartsForFiles(transform(fg->sources, &FileName::toString))));
}
qDeleteAll(m_projects); // Not used anymore!
m_projects.clear();
m_targets.clear();
m_fileGroups.clear();
return languages;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment