[gtk+/gtk-2-22] container: don't leak the focus_child ref count



commit d945a3cef4b064a588901b74f971060df220cb8d
Author: Stefan Kost <ensonic users sf net>
Date:   Fri Aug 20 13:48:17 2010 +0300

    container: don't leak the focus_child ref count
    
    gtk_conatiner_set_focus_child() takes a ref. Release the ref in _destroy().
    Fixes #414712.

 gtk/gtkcontainer.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 6bedc86..0154dd2 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1057,6 +1057,12 @@ gtk_container_destroy (GtkObject *object)
   if (GTK_CONTAINER_RESIZE_PENDING (container))
     _gtk_container_dequeue_resize_handler (container);
 
+  if (container->focus_child)
+    {
+      g_object_unref (container->focus_child);
+      container->focus_child = NULL;
+    }
+
   /* do this before walking child widgets, to avoid
    * removing children from focus chain one by one.
    */



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