[cogl/cogl-1.16] wayland: free framebuffer's shell surface on destroy



commit 4327b7a364ec52e20420ff42006b3d00f444a083
Author: Chris Cummins <christopher e cummins intel com>
Date:   Fri Apr 26 15:04:36 2013 +0100

    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)

 cogl/winsys/cogl-winsys-egl-wayland.c |   10 ++++++++++
 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 eaf97af..1444564 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);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]