Fix a possible crash in FindReferences on shutdown

Cancel and wait for all threads started by FindReferences
in its destructor.

Task-number: QTCREATORBUG-25711
Change-Id: I83c3ea832a173a7fff5c52e0c0136dfff2234afe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2021-05-11 09:26:15 +02:00
parent c4236da9d1
commit 492f13578e
2 changed files with 6 additions and 0 deletions

View File

@@ -27,6 +27,8 @@
#include "qmljseditor_global.h"
#include <utils/futuresynchronizer.h>
#include <QObject>
#include <QFutureWatcher>
#include <QPointer>
@@ -81,6 +83,7 @@ private:
QPointer<Core::SearchResult> m_currentSearch;
QFutureWatcher<Usage> m_watcher;
Utils::FutureSynchronizer m_synchronizer;
};
} // namespace QmlJSEditor