aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2024-02-19 13:49:03 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2024-02-20 16:19:06 +0000
commit2cb18715ebbcacb99c5aec5db5e4ca12daad491f (patch)
tree76b314b3e8b8986da09054e1abc8f8484bad8d34
parentaf54f62166c67b471243177b8caad21ac4634cf2 (diff)
CppUseSelectionsUpdater: Ensure the old futures are synchronized
When scheduling a new async run (via FindUses::find()), keep track for the canceled futures, otherwise they may still be running after the shutdown. So, add all new futures into the future synchronizer (without canceling them). Task-number: QTCREATORBUG-30401 Change-Id: I83a82f706175060f7f29886b57c69c77667a0805 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r--src/plugins/cppeditor/cppuseselectionsupdater.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.cpp b/src/plugins/cppeditor/cppuseselectionsupdater.cpp
index 3b9fe40a89e..67fb6d7a1bc 100644
--- a/src/plugins/cppeditor/cppuseselectionsupdater.cpp
+++ b/src/plugins/cppeditor/cppuseselectionsupdater.cpp
@@ -7,6 +7,9 @@
#include "cppeditorwidget.h"
#include "cppmodelmanager.h"
+#include <extensionsystem/pluginmanager.h>
+
+#include <utils/futuresynchronizer.h>
#include <utils/qtcassert.h>
#include <utils/textutils.h>
@@ -72,6 +75,7 @@ CppUseSelectionsUpdater::RunnerInfo CppUseSelectionsUpdater::update(CallType cal
m_runnerWordStartPosition = params.textCursor.position();
m_runnerWatcher->setFuture(cppEditorDocument->cursorInfo(params));
+ ExtensionSystem::PluginManager::futureSynchronizer()->addFuture(m_runnerWatcher->future());
return RunnerInfo::Started;
} else { // synchronous case
abortSchedule();