libqt5-qtwayland/0006-Fix-leaked-subsurface-wayland-items.patch
Luca Beltrame be48647d50 Accepting request 883510 from home:Vogtinator:qt5.15
- Add commits from upstream's 5.15 branch:
  * 0002-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch (QTBUG-87762)
  * 0003-Do-not-try-to-eglMakeCurrent-for-unintended-case.patch (QTBUG-88277)
  * 0004-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch (QTBUG-87762, QTBUG-88064)
  * 0005-Ensure-that-grabbing-is-performed-in-correct-context.patch (QTBUG-87597)
  * 0006-Fix-leaked-subsurface-wayland-items.patch (QTBUG-88782)
- Add commit from KDE's 5.15 branch:
  * 0007-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch

OBS-URL: https://build.opensuse.org/request/show/883510
OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:5.15/libqt5-qtwayland?expand=0&rev=14
2021-04-07 07:20:26 +00:00

37 lines
1.7 KiB
Diff

From a8d35b3c18bdb05a0da3ed50a554a7b7bd4ebed3 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Date: Mon, 30 Nov 2020 13:13:18 +0100
Subject: [PATCH 6/7] 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.
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>
---
src/compositor/compositor_api/qwaylandquickitem.cpp | 1 +
1 file changed, 1 insertion(+)
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)
--
2.25.1