From 0f9595ae098281b7fae4bf01d7d978a780314c77 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 3 Aug 2018 11:30:33 +0200 Subject: [PATCH] Client: Fix memory leak for xdg_popup and xdg_toplevel Change-Id: I561e2af0cdc812ea4f499525b4af0a4ab7ad8182 Reviewed-by: Paul Olav Tvete --- .../shellintegration/xdg-shell/qwaylandxdgshell.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index cab7dc08e84..eac33aa7ad7 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -190,10 +190,14 @@ QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *shell, ::xdg_surface *s QWaylandXdgSurface::~QWaylandXdgSurface() { - if (m_toplevel) - xdg_toplevel_destroy(m_toplevel->object()); - if (m_popup) - xdg_popup_destroy(m_popup->object()); + if (m_toplevel) { + delete m_toplevel; + m_toplevel = nullptr; + } + if (m_popup) { + delete m_popup; + m_popup = nullptr; + } destroy(); }