Commit 937340cc authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Don't process the documents from QtConcurrent threads.

parent a744a731
...@@ -214,7 +214,6 @@ private: ...@@ -214,7 +214,6 @@ private:
Document::Ptr m_currentDoc; Document::Ptr m_currentDoc;
QSet<QString> m_todo; QSet<QString> m_todo;
QSet<QString> m_processed; QSet<QString> m_processed;
QFutureSynchronizer<void> m_synchronizer;
}; };
} // namespace Internal } // namespace Internal
...@@ -224,9 +223,7 @@ CppPreprocessor::CppPreprocessor(QPointer<CppModelManager> modelManager) ...@@ -224,9 +223,7 @@ CppPreprocessor::CppPreprocessor(QPointer<CppModelManager> modelManager)
: snapshot(modelManager->snapshot()), : snapshot(modelManager->snapshot()),
m_modelManager(modelManager), m_modelManager(modelManager),
preprocess(this, &env) preprocess(this, &env)
{ { }
m_synchronizer.setCancelOnWait(true);
}
CppPreprocessor::~CppPreprocessor() CppPreprocessor::~CppPreprocessor()
{ } { }
...@@ -510,7 +507,9 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type, ...@@ -510,7 +507,9 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type,
snapshot.insert(doc->fileName(), doc); snapshot.insert(doc->fileName(), doc);
m_todo.remove(fileName); m_todo.remove(fileName);
m_synchronizer.addFuture(QtConcurrent::run(Process(m_modelManager), doc)); Process process(m_modelManager);
process(doc);
(void) switchDocument(previousDoc); (void) switchDocument(previousDoc);
} }
......
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