From 844a5e624a255760acecc09ba5ce57ed20c8fa64 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 18 Feb 2022 08:59:27 +0100 Subject: [PATCH] Editor: make sure to cleanup select all future watcher Change-Id: I39e1bc7926905684601eb72cdd7a4357c708c432 Reviewed-by: Eike Ziller --- src/plugins/texteditor/texteditor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index a36caf3befc..81c833e72ed 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -835,6 +835,8 @@ public: setMultiTextCursorProvider([editor]() { return editor->multiTextCursor(); }); } + ~TextEditorWidgetFind() override { cancelCurrentSelectAll(); } + bool supportsSelectAll() const override { return true; } void selectAll(const QString &txt, FindFlags findFlags) override; @@ -858,6 +860,8 @@ void TextEditorWidgetFind::selectAll(const QString &txt, FindFlags findFlags) connect(m_selectWatcher, &QFutureWatcher::finished, this, [this]() { const QFuture future = m_selectWatcher->future(); + m_selectWatcher->deleteLater(); + m_selectWatcher = nullptr; if (future.resultCount() <= 0) return; const FileSearchResultList &results = future.result();