From 13f4519ed4d73bb025882109d9c78bd3ad53b520 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 29 Jan 2021 14:23:35 +0100 Subject: [PATCH] FileSystemFilter: store the value of includeHidden in prepareSearch() Since we don't guarantee the synchronization between a call to openConfigDialog() and matchesFor(), it may happen that these two methods are called simultaneously by two different threads. In theory, the value of m_includeHidden may be changed in gui thread by a call to openConfigDialog(), while at the same time it may be read in other thread, inside matchesFor(). As a safe solution we make a copy of this value inside prepareSearch() and use the copy later in matchesFor(). Change-Id: I83fb184ff1914e4c02ee799464ff0d89350ab49c Reviewed-by: Eike Ziller --- src/plugins/coreplugin/locator/filesystemfilter.cpp | 3 ++- src/plugins/coreplugin/locator/filesystemfilter.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/locator/filesystemfilter.cpp b/src/plugins/coreplugin/locator/filesystemfilter.cpp index 9c3f8ae06aa..5ed25277f43 100644 --- a/src/plugins/coreplugin/locator/filesystemfilter.cpp +++ b/src/plugins/coreplugin/locator/filesystemfilter.cpp @@ -74,6 +74,7 @@ void FileSystemFilter::prepareSearch(const QString &entry) { Q_UNUSED(entry) m_currentDocumentDirectory = DocumentManager::fileDialogInitialDirectory(); + m_currentIncludeHidden = m_includeHidden; } QList FileSystemFilter::matchesFor(QFutureInterface &future, @@ -92,7 +93,7 @@ QList FileSystemFilter::matchesFor(QFutureInterface