Blame SOURCES/0010-Fix-leaked-subsurface-wayland-items.patch

0cfe39
From a8d35b3c18bdb05a0da3ed50a554a7b7bd4ebed3 Mon Sep 17 00:00:00 2001
0cfe39
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
0cfe39
Date: Mon, 30 Nov 2020 13:13:18 +0100
147f94
Subject: [PATCH 10/36] Fix leaked subsurface wayland items
0cfe39
0cfe39
Whenever a subsurface was added we would create a QWaylandQuickItem,
0cfe39
but this was never deleted. It is one-to-one with the surface, so it
0cfe39
should be deleted at the same time.
0cfe39
0cfe39
[ChangeLog][QtWaylandCompositor] Fixed a memory leak when creating
0cfe39
subsurfaces.
0cfe39
0cfe39
Task-number: QTBUG-88782
0cfe39
Change-Id: If4b3f15200ce3bd123ff73847d3593d174a39229
0cfe39
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
0cfe39
(cherry picked from commit 38fc568b30bf916165324c2cd2db127d2a9aa68c)
0cfe39
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
0cfe39
---
0cfe39
 src/compositor/compositor_api/qwaylandquickitem.cpp | 1 +
0cfe39
 1 file changed, 1 insertion(+)
0cfe39
0cfe39
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
0cfe39
index 15f0195c..2218f43a 100644
0cfe39
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
0cfe39
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
0cfe39
@@ -737,6 +737,7 @@ void QWaylandQuickItem::handleSubsurfaceAdded(QWaylandSurface *childSurface)
0cfe39
         childItem->setVisible(true);
0cfe39
         childItem->setParentItem(this);
0cfe39
         connect(childSurface, &QWaylandSurface::subsurfacePositionChanged, childItem, &QWaylandQuickItem::handleSubsurfacePosition);
0cfe39
+        connect(childSurface, &QWaylandSurface::destroyed, childItem, &QObject::deleteLater);
0cfe39
     } else {
0cfe39
         bool success = QMetaObject::invokeMethod(d->subsurfaceHandler, "handleSubsurfaceAdded", Q_ARG(QWaylandSurface *, childSurface));
0cfe39
         if (!success)
0cfe39
-- 
147f94
2.33.1
0cfe39