QmlJSModelManager: Cleanup uses of QFuture

- Use simple list instead of QFutureSynchronizer (no feature of that was
  used)
- Avoid duplicate code cleaning up the current list of running futures
- Clean list of running futures after waiting for them all to finish

Change-Id: Ia13ee25ab7835fc4f4970d23d20b16cfe6bf6dfb
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Eike Ziller
2016-01-22 11:04:52 +01:00
parent 677effda78
commit a30c1adc96
2 changed files with 22 additions and 31 deletions

View File

@@ -36,7 +36,6 @@
#include <utils/environment.h>
#include <QFuture>
#include <QFutureSynchronizer>
#include <QHash>
#include <QObject>
#include <QPointer>
@@ -250,6 +249,8 @@ protected:
void setDefaultProject(const ProjectInfo &pInfo, ProjectExplorer::Project *p);
private:
void cleanupFutures();
mutable QMutex m_mutex;
QmlJS::Snapshot m_validSnapshot;
QmlJS::Snapshot m_newestSnapshot;
@@ -278,7 +279,7 @@ private:
PluginDumper *m_pluginDumper;
QFutureSynchronizer<void> m_synchronizer;
QList<QFuture<void>> m_futures;
bool m_indexerEnabled;
};