Mocking compositor: Don't leak wl_shell_surfaces

Change-Id: Ic133b41bdcfb98418be4a0141f382734f1d5db85
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Johan Klokkhammer Helsing 2018-03-09 14:40:52 +01:00 committed by Johan Helsing
parent 08d8136071
commit e6c84abc55

View File

@ -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);
}