wayland: free framebuffer's shell surface on destroy

This prevents leaking the Wayland shell surface associated with a Cogl
OnScreen when it is finalised.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 760fc9f3af5475530262b82a55df311fceca358a)
This commit is contained in:
Chris Cummins 2013-04-26 15:04:36 +01:00 committed by Robert Bragg
parent afbb13e1a4
commit 4327b7a364

View File

@ -375,12 +375,22 @@ _cogl_winsys_egl_onscreen_deinit (CoglOnscreen *onscreen)
wayland_onscreen->wayland_egl_native_window = NULL;
}
/* NB: The wayland protocol docs explicitly state that
* "wl_shell_surface_destroy() must be called before destroying the
* wl_surface object." ... */
if (wayland_onscreen->wayland_shell_surface)
{
wl_shell_surface_destroy (wayland_onscreen->wayland_shell_surface);
wayland_onscreen->wayland_shell_surface = NULL;
}
if (wayland_onscreen->wayland_surface)
{
wl_surface_destroy (wayland_onscreen->wayland_surface);
wayland_onscreen->wayland_surface = NULL;
}
g_slice_free (CoglOnscreenWayland, wayland_onscreen);
}