[gtk+] Fix leaks of clip region and outstanding moves



commit 7667c4d8dc1c1fb558942609a0daa277e35fc7e4
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Aug 13 16:48:07 2009 +0200

    Fix leaks of clip region and outstanding moves
    
    We're never freeing these, do so when destroying.
    Fixes bug 589877

 gdk/gdkwindow.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 1c1bb32..ba4ad63 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -329,6 +329,7 @@ static void do_move_region_bits_on_impl (GdkWindowObject *private,
 static void gdk_window_invalidate_in_parent (GdkWindowObject *private);
 static void move_native_children (GdkWindowObject *private);
 static void update_cursor (GdkDisplay *display);
+static void gdk_window_region_move_free (GdkWindowRegionMove *move);
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
@@ -1867,6 +1868,25 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
 	      g_object_unref (display->pointer_info.toplevel_under_pointer);
 	      display->pointer_info.toplevel_under_pointer = NULL;
 	    }
+
+	  if (private->clip_region)
+	    {
+	      gdk_region_destroy (private->clip_region);
+	      private->clip_region = NULL;
+	    }
+
+	  if (private->clip_region_with_children)
+	    {
+	      gdk_region_destroy (private->clip_region_with_children);
+	      private->clip_region_with_children = NULL;
+	    }
+
+	  if (private->outstanding_moves)
+	    {
+	      g_list_foreach (private->outstanding_moves, gdk_window_region_move_free, NULL);
+	      g_list_free (private->outstanding_moves);
+	      private->outstanding_moves = NULL;
+	    }
 	}
       break;
     }



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