[gtk+/wip/csd: 61/65] stash: reorder the destroy after attach of new buffer (?)



commit 345de550c9fc6b88875d31eb18b567a629390686
Author: Rob Bradford <rob linux intel com>
Date:   Fri Jul 27 11:40:35 2012 +0100

    stash: reorder the destroy after attach of new buffer (?)

 gdk/wayland/gdkwindow-wayland.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 2635c39..0f5ab4b 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -319,6 +319,7 @@ gdk_wayland_window_attach_image (GdkWindow *window)
   GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
   GdkWaylandCairoSurfaceData *data;
   int32_t server_width, server_height, dx, dy;
+  cairo_surface_t *old_server_surface = NULL;
 
   if (GDK_WINDOW_DESTROYED (window))
     return;
@@ -342,7 +343,7 @@ gdk_wayland_window_attach_image (GdkWindow *window)
       server_width = data->width;
       server_height = data->height;
 
-      cairo_surface_destroy (impl->server_surface);
+      old_server_surface = impl->server_surface;
     }
   else
     {
@@ -369,6 +370,9 @@ gdk_wayland_window_attach_image (GdkWindow *window)
 
   /* Attach this new buffer to the surface */
   wl_surface_attach (impl->surface, data->buffer, dx, dy);
+
+  if (old_server_surface)
+    cairo_surface_destroy (old_server_surface);
 }
 
 static void



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