Commit 756fba0d authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Use mutex when accessing m_fileToProjectParts

projectPartFromDependencies() is also called from another thread.

Change-Id: Ic1319569d1b9b934a1be0916caa2e5bd68dce4fb
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent 390b4f0e
......@@ -811,8 +811,12 @@ QList<ProjectPart::Ptr> CppModelManager::projectPartFromDependencies(const QStri
{
QSet<ProjectPart::Ptr> parts;
const QStringList deps = snapshot().filesDependingOn(fileName);
foreach (const QString &dep, deps)
parts.unite(QSet<ProjectPart::Ptr>::fromList(d->m_fileToProjectParts.value(dep)));
{
QMutexLocker locker(&d->m_projectMutex);
foreach (const QString &dep, deps)
parts.unite(QSet<ProjectPart::Ptr>::fromList(d->m_fileToProjectParts.value(dep)));
}
return parts.values();
}
......
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