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:
@@ -144,9 +144,6 @@ ClangEditorDocumentProcessor::~ClangEditorDocumentProcessor()
|
||||
void ClangEditorDocumentProcessor::run()
|
||||
{
|
||||
// Run clang parser
|
||||
const CppTools::WorkingCopy workingCopy
|
||||
= CppTools::CppModelManager::instance()->workingCopy();
|
||||
|
||||
disconnect(&m_parserWatcher, &QFutureWatcher<void>::finished,
|
||||
this, &ClangEditorDocumentProcessor::onParserFinished);
|
||||
m_parserWatcher.cancel();
|
||||
@@ -155,7 +152,9 @@ void ClangEditorDocumentProcessor::run()
|
||||
m_parserRevision = revision();
|
||||
connect(&m_parserWatcher, &QFutureWatcher<void>::finished,
|
||||
this, &ClangEditorDocumentProcessor::onParserFinished);
|
||||
const QFuture<void> future = QtConcurrent::run(&runParser, parser(), workingCopy);
|
||||
const QFuture<void> future = QtConcurrent::run(&runParser,
|
||||
parser(),
|
||||
ClangEditorDocumentParser::InMemoryInfo(true));
|
||||
m_parserWatcher.setFuture(future);
|
||||
|
||||
// Run builtin processor
|
||||
|
||||
Reference in New Issue
Block a user