summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-11-30 13:13:18 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-07 09:59:43 +0000
commita8d35b3c18bdb05a0da3ed50a554a7b7bd4ebed3 (patch)
tree0ad5a1eb240556ca0570e25fa27866e268069715
parentdba4bc4f1d6dfee9fe9433c55b15653d703bed4f (diff)
Fix leaked subsurface wayland items5.15
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. Task-number: QTBUG-88782 Change-Id: If4b3f15200ce3bd123ff73847d3593d174a39229 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 38fc568b30bf916165324c2cd2db127d2a9aa68c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 15f0195c..2218f43a 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -737,6 +737,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)