From 4327b7a364ec52e20420ff42006b3d00f444a083 Mon Sep 17 00:00:00 2001 From: Chris Cummins Date: Fri, 26 Apr 2013 15:04:36 +0100 Subject: [PATCH] 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 (cherry picked from commit 760fc9f3af5475530262b82a55df311fceca358a) --- cogl/winsys/cogl-winsys-egl-wayland.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cogl/winsys/cogl-winsys-egl-wayland.c b/cogl/winsys/cogl-winsys-egl-wayland.c index eaf97af77..144456481 100644 --- a/cogl/winsys/cogl-winsys-egl-wayland.c +++ b/cogl/winsys/cogl-winsys-egl-wayland.c @@ -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); }