From e6c84abc5574c82018d693ba95dba6025cb0b30f Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 9 Mar 2018 14:40:52 +0100 Subject: [PATCH] Mocking compositor: Don't leak wl_shell_surfaces Change-Id: Ic133b41bdcfb98418be4a0141f382734f1d5db85 Reviewed-by: Andy Nichols --- tests/auto/wayland/shared/mocksurface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/wayland/shared/mocksurface.cpp b/tests/auto/wayland/shared/mocksurface.cpp index 4139d64fe9f..81a865f1194 100644 --- a/tests/auto/wayland/shared/mocksurface.cpp +++ b/tests/auto/wayland/shared/mocksurface.cpp @@ -115,6 +115,10 @@ void Surface::surface_destroy_resource(Resource *) void Surface::surface_destroy(Resource *resource) { + if (m_wlShellSurface) // on wl-shell the shell surface is automatically destroyed with the surface + wl_resource_destroy(m_wlShellSurface->resource()->handle); + Q_ASSERT(!m_wlShellSurface); + Q_ASSERT(!m_xdgToplevelV6); wl_resource_destroy(resource->handle); }