1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

SearchToolBar: Guard against running search callback after toolbar was deleted

This commit is contained in:
David Rosca 2017-08-25 16:11:40 +02:00
parent 418333d453
commit 1387baade0

View File

@ -113,7 +113,11 @@ void SearchToolBar::caseSensitivityChanged()
void SearchToolBar::searchText(const QString &text)
{
m_view->findText(text, m_findFlags, [this](bool found) {
QPointer<SearchToolBar> guard = this;
m_view->findText(text, m_findFlags, [=](bool found) {
if (!guard) {
return;
}
if (ui->lineEdit->text().isEmpty())
found = true;