Client: Fix memory leak for xdg_popup and xdg_toplevel

Change-Id: I561e2af0cdc812ea4f499525b4af0a4ab7ad8182
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
Johan Klokkhammer Helsing 2018-08-03 11:30:33 +02:00 committed by Johan Helsing
parent 8ce206f324
commit 0f9595ae09

View File

@ -190,10 +190,14 @@ QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *shell, ::xdg_surface *s
QWaylandXdgSurface::~QWaylandXdgSurface() QWaylandXdgSurface::~QWaylandXdgSurface()
{ {
if (m_toplevel) if (m_toplevel) {
xdg_toplevel_destroy(m_toplevel->object()); delete m_toplevel;
if (m_popup) m_toplevel = nullptr;
xdg_popup_destroy(m_popup->object()); }
if (m_popup) {
delete m_popup;
m_popup = nullptr;
}
destroy(); destroy();
} }