From 5751ca2b246b1d43886da13a57539df43793ac8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9ven=20Car?= Date: Sat, 14 Sep 2024 14:02:26 +0200 Subject: [PATCH] libtaskmanager/waylandtasksmodel: disconnect from parentWindowChanged in dtor As windows destruction might happen in any order, destruction of parent window of of transient ones will trigger their parentWindowChanged event. BUG: 488653 (cherry picked from commit 561646763d994288d771b0efaa9b2a3e45e810fa) --- libtaskmanager/waylandtasksmodel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libtaskmanager/waylandtasksmodel.cpp b/libtaskmanager/waylandtasksmodel.cpp index 4081b16edf2..85778bc6d59 100644 --- a/libtaskmanager/waylandtasksmodel.cpp +++ b/libtaskmanager/waylandtasksmodel.cpp @@ -845,7 +845,12 @@ WaylandTasksModel::WaylandTasksModel(QObject *parent) d->init(); } -WaylandTasksModel::~WaylandTasksModel() = default; +WaylandTasksModel::~WaylandTasksModel() +{ + for (auto &window : d->windows) { + QObject::disconnect(window.get(), &PlasmaWindow::parentWindowChanged, this, nullptr); + } +} QVariant WaylandTasksModel::data(const QModelIndex &index, int role) const { -- GitLab