Commit 779ba1bc authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

disconnect m_tasksModel before marking it for deletion

otherwise we might get further signals from it and subsequently crash
when trying to call m_tasksModel->index() in the slot lambda again

BUG: 435811
FIXED-IN: 5.22
parent 6257a98e
/*
SPDX-FileCopyrightText: 2017 Kai Uwe Broulik <kde@privat.broulik.de>
SPDX-FileCopyrightText: 2017 David Edmundson <davidedmundson@kde.org>
SPDX-FileCopyrightText: 2021 Harald Sitter <sitter@kde.org>
SPDX-License-Identifier: MIT
*/
......@@ -223,6 +224,7 @@ bool Settings::setEnvironmentFromTasksModelIndex(const QModelIndex &idx)
qApp->setDesktopFileName(service->desktopEntryName());
qApp->setWindowIcon(QIcon::fromTheme(service->icon()));
m_tasksModel->disconnect(this); // prevent further signal emission to not deref a nullptr https://bugs.kde.org/show_bug.cgi?id=435811
m_tasksModel->deleteLater();
m_tasksModel = nullptr;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment