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:
Nikolai Kosjar
2015-07-10 14:57:42 +02:00
parent 5902a62298
commit 418fc32f6a
18 changed files with 69 additions and 38 deletions

View File

@@ -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