C++: Clear state in DependencyTable::build

...since build() is called multiple times for e.g. the global snapshot
(CppModelManager::projectPartFromDependencies,
CppModelManager::replaceDocument).

Change-Id: I03667496a5abc984ba976046dc7b76998a6e3336
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Nikolai Kosjar
2014-09-19 14:26:28 +02:00
committed by hjk
parent 1af0f77ea9
commit 79f0ab18c3

View File

@@ -52,6 +52,12 @@ QStringList DependencyTable::filesDependingOn(const QString &fileName) const
void DependencyTable::build(const Snapshot &snapshot) void DependencyTable::build(const Snapshot &snapshot)
{ {
includesPerFile.clear();
files.clear();
fileIndex.clear();
includes.clear();
includeMap.clear();
const int documentCount = snapshot.size(); const int documentCount = snapshot.size();
files.resize(documentCount); files.resize(documentCount);
includeMap.resize(documentCount); includeMap.resize(documentCount);