[gtk+] broadway: destroy old surface before creating new one



commit b7a1561fef74144162613eb36978e5b7cb67a545
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Apr 3 15:46:21 2013 +0200

    broadway: destroy old surface before creating new one
    
    We were not using the old one anyway, and this may in some cases
    use less memory (although in most cases the server has a ref to the
    surface anyway).

 gdk/broadway/gdkwindow-broadway.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 103f091..3784b5a 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -271,16 +271,13 @@ void
 _gdk_broadway_window_resize_surface (GdkWindow *window)
 {
   GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
-  cairo_surface_t *old;
 
   if (impl->surface)
     {
-      old = impl->surface;
+      cairo_surface_destroy (impl->surface);
 
       impl->surface = _gdk_broadway_server_create_surface (gdk_window_get_width (impl->wrapper),
                                                           gdk_window_get_height (impl->wrapper));
-
-      cairo_surface_destroy (old);
     }
 
   if (impl->ref_surface)


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