Commit 99805d3c authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Prune the list of the futures.

parent 047e5af2
...@@ -712,6 +712,17 @@ QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles ...@@ -712,6 +712,17 @@ QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles
QFuture<void> result = QtConcurrent::run(&CppModelManager::parse, QFuture<void> result = QtConcurrent::run(&CppModelManager::parse,
preproc, sourceFiles); preproc, sourceFiles);
if (m_synchronizer.futures().size() > 10) {
QList<QFuture<void> > futures = m_synchronizer.futures();
m_synchronizer.clearFutures();
foreach (QFuture<void> future, futures) {
if (! (future.isFinished() || future.isCanceled()))
m_synchronizer.addFuture(future);
}
}
m_synchronizer.addFuture(result); m_synchronizer.addFuture(result);
if (sourceFiles.count() > 1) { if (sourceFiles.count() > 1) {
......
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