forked from qt-creator/qt-creator
Clang: Do not call DocumentManager::modifiedDocuments() from worker thread
This is unsafe. Change-Id: I8ac075a7289afa0d84785e37b1325d186a153000 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include "baseeditordocumentparser.h"
|
||||
#include "baseeditordocumentprocessor.h"
|
||||
|
||||
#include "cppworkingcopy.h"
|
||||
#include "cpptoolsreuse.h"
|
||||
#include "editordocumenthandle.h"
|
||||
|
||||
namespace CppTools {
|
||||
@@ -81,10 +81,10 @@ void BaseEditorDocumentParser::setConfiguration(const Configuration &configurati
|
||||
m_configuration = configuration;
|
||||
}
|
||||
|
||||
void BaseEditorDocumentParser::update(WorkingCopy workingCopy)
|
||||
void BaseEditorDocumentParser::update(const InMemoryInfo &info)
|
||||
{
|
||||
QMutexLocker locker(&m_updateIsRunning);
|
||||
updateHelper(workingCopy);
|
||||
updateHelper(info);
|
||||
}
|
||||
|
||||
BaseEditorDocumentParser::State BaseEditorDocumentParser::state() const
|
||||
@@ -147,4 +147,11 @@ ProjectPart::Ptr BaseEditorDocumentParser::determineProjectPart(const QString &f
|
||||
return projectPart;
|
||||
}
|
||||
|
||||
BaseEditorDocumentParser::InMemoryInfo::InMemoryInfo(bool withModifiedFiles)
|
||||
: workingCopy(CppTools::CppModelManager::instance()->workingCopy())
|
||||
{
|
||||
if (withModifiedFiles)
|
||||
modifiedFiles = CppTools::modifiedFiles();
|
||||
}
|
||||
|
||||
} // namespace CppTools
|
||||
|
||||
Reference in New Issue
Block a user