summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cummins <christopher.e.cummins@intel.com>2013-04-26 15:04:36 +0100
committerNeil Roberts <neil@linux.intel.com>2013-06-11 16:29:11 +0100
commit06ed8c7d02b3397a4615d0c45676ad7195003da0 (patch)
tree9e6f958b131af6ab005d62cc3abc698752edc208
parentcfe2c61538efde74bf1ae2ee8d3b5ec0999119ba (diff)
downloadcogl-06ed8c7d02b3397a4615d0c45676ad7195003da0.tar.gz
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)
-rw-r--r--cogl/winsys/cogl-winsys-egl-wayland.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cogl/winsys/cogl-winsys-egl-wayland.c b/cogl/winsys/cogl-winsys-egl-wayland.c
index feeb529d..156ecb9f 100644
--- a/cogl/winsys/cogl-winsys-egl-wayland.c
+++ b/cogl/winsys/cogl-winsys-egl-wayland.c
@@ -370,12 +370,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);
}