forked from qt-creator/qt-creator
ClassView: Clear the documentCache, too, when reset was requested
Otherwise when we switch session we still keep the data about the old session in the cache, which is pointless. Protect clearing both caches with both mutexes, so it comes atomically. Task-number: QTCREATORBUG-25317 Change-Id: Ic5bc7ae2b8640e9290024e00c394ca9608f88da9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -549,12 +549,10 @@ void Parser::removeFiles(const QStringList &fileList)
|
||||
void Parser::resetData(const CPlusPlus::Snapshot &snapshot)
|
||||
{
|
||||
{
|
||||
QWriteLocker locker(&d->m_projectLock);
|
||||
QWriteLocker projectLocker(&d->m_projectLock);
|
||||
QWriteLocker documentLocker(&d->m_documentLock);
|
||||
d->m_projectCache.clear();
|
||||
}
|
||||
|
||||
{
|
||||
QWriteLocker locker(&d->m_documentLock);
|
||||
d->m_documentCache.clear();
|
||||
for (auto it = snapshot.begin(); it != snapshot.end(); ++it)
|
||||
d->m_documentCache[it.key().toString()].document = it.value();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user