aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2019-01-10 17:32:40 +0000
committerDavid Edmundson <[email protected]>2019-01-10 17:33:08 +0000
commitb55d27699481a9bcaf6a889cf168083a30e04521 (patch)
tree3eff3457a83b6f564b55c3bcb464b3d49c4572ef
parent14b827daaaad4e4b3f0c4036f8e90f9a7d91001e (diff)
Cleanup virutal desktops in deleted
Summary: virtual desktops can be destroyed, active clients update, but deleted keeps a cache. Someone needs to do cleanup to avoid dangly pointers. Test Plan: I couldn't find a case of someone calling desktops mid way through an animation, so it's only a hypothetical bug. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: graesslin, zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D17247
-rw-r--r--deleted.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/deleted.cpp b/deleted.cpp
index 1fc12dc..7429bc1 100644
--- a/deleted.cpp
+++ b/deleted.cpp
@@ -141,6 +141,12 @@ void Deleted::copyToDeleted(Toplevel* c)
m_wasGroupTransient = x11Client && x11Client->groupTransient();
}
+ for (auto vd : m_desktops) {
+ connect(vd, &QObject::destroyed, this, [=] {
+ m_desktops.removeOne(vd);
+ });
+ }
+
m_wasWaylandClient = qobject_cast<ShellClient *>(c) != nullptr;
m_wasX11Client = !m_wasWaylandClient;
m_wasPopupWindow = c->isPopupWindow();