summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-11-30 13:13:18 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-12-07 10:32:25 +0100
commit38fc568b30bf916165324c2cd2db127d2a9aa68c (patch)
treee1529556c41495298e9389241439fd58d382dd5a /src
parent1eeb269f7a4be99b504d205ae52bd1299747fab6 (diff)
Fix leaked subsurface wayland items
Whenever a subsurface was added we would create a QWaylandQuickItem, but this was never deleted. It is one-to-one with the surface, so it should be deleted at the same time. [ChangeLog][QtWaylandCompositor] Fixed a memory leak when creating subsurfaces. Pick-to: 5.15 5.12 Task-number: QTBUG-88782 Change-Id: If4b3f15200ce3bd123ff73847d3593d174a39229 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index 36d0b3715..cf0994ba7 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -755,6 +755,7 @@ void QWaylandQuickItem::handleSubsurfaceAdded(QWaylandSurface *childSurface)
childItem->setVisible(true);
childItem->setParentItem(this);
connect(childSurface, &QWaylandSurface::subsurfacePositionChanged, childItem, &QWaylandQuickItem::handleSubsurfacePosition);
+ connect(childSurface, &QWaylandSurface::destroyed, childItem, &QObject::deleteLater);
} else {
bool success = QMetaObject::invokeMethod(d->subsurfaceHandler, "handleSubsurfaceAdded", Q_ARG(QWaylandSurface *, childSurface));
if (!success)