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

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