summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2022-02-18 08:59:27 +0100
committerDavid Schulz <david.schulz@qt.io>2022-02-18 11:04:51 +0000
commit844a5e624a255760acecc09ba5ce57ed20c8fa64 (patch)
tree1ecc757f0e810e3498297aadd940120cb4281165 /src
parent61d5bbbdadc54d2ad02d4a98f04285d6ffc0f282 (diff)
downloadqt-creator-844a5e624a255760acecc09ba5ce57ed20c8fa64.tar.gz
Editor: make sure to cleanup select all future watcher
Change-Id: I39e1bc7926905684601eb72cdd7a4357c708c432 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/texteditor/texteditor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp
index a36caf3bef..81c833e72e 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<Utils::FileSearchResultList>::finished,
this, [this]() {
const QFuture<FileSearchResultList> future = m_selectWatcher->future();
+ m_selectWatcher->deleteLater();
+ m_selectWatcher = nullptr;
if (future.resultCount() <= 0)
return;
const FileSearchResultList &results = future.result();