diff --git a/src/plugins/languageclient/locatorfilter.cpp b/src/plugins/languageclient/locatorfilter.cpp index 2f8d8744694..e51aed5aa74 100644 --- a/src/plugins/languageclient/locatorfilter.cpp +++ b/src/plugins/languageclient/locatorfilter.cpp @@ -153,9 +153,9 @@ void DocumentLocatorFilter::prepareSearch(const QString &/*entry*/) QList DocumentLocatorFilter::matchesFor( QFutureInterface &future, const QString &entry) { + QMutexLocker locker(&m_mutex); if (!m_symbolCache) return {}; - QMutexLocker locker(&m_mutex); if (!m_currentSymbols.has_value()) { QEventLoop loop; connect(this, &DocumentLocatorFilter::symbolsUpToDate, &loop, [&]() { loop.exit(1); });