From 1387baade066e77f59a41eeab8aa121f9e2f2fe7 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 25 Aug 2017 16:11:40 +0200 Subject: [PATCH] SearchToolBar: Guard against running search callback after toolbar was deleted --- src/lib/webtab/searchtoolbar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/webtab/searchtoolbar.cpp b/src/lib/webtab/searchtoolbar.cpp index 8168632ad..d233fc805 100644 --- a/src/lib/webtab/searchtoolbar.cpp +++ b/src/lib/webtab/searchtoolbar.cpp @@ -113,7 +113,11 @@ void SearchToolBar::caseSensitivityChanged() void SearchToolBar::searchText(const QString &text) { - m_view->findText(text, m_findFlags, [this](bool found) { + QPointer guard = this; + m_view->findText(text, m_findFlags, [=](bool found) { + if (!guard) { + return; + } if (ui->lineEdit->text().isEmpty()) found = true;