[gtk+] stackswitcher: do not leak buttons hash table



commit 63b90bb5b8056f60abe4e8ab0d2a73c2d2cad93f
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Mar 29 23:14:51 2014 +0100

    stackswitcher: do not leak buttons hash table

 gtk/gtkstackswitcher.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c
index 361bd54..d5b7ef1 100644
--- a/gtk/gtkstackswitcher.c
+++ b/gtk/gtkstackswitcher.c
@@ -479,6 +479,19 @@ gtk_stack_switcher_dispose (GObject *object)
 }
 
 static void
+gtk_stack_switcher_finalize (GObject *object)
+{
+  GtkStackSwitcher *switcher = GTK_STACK_SWITCHER (object);
+  GtkStackSwitcherPrivate *priv;
+
+  priv = gtk_stack_switcher_get_instance_private (switcher);
+
+  g_hash_table_destroy (priv->buttons);
+
+  G_OBJECT_CLASS (gtk_stack_switcher_parent_class)->finalize (object);
+}
+
+static void
 gtk_stack_switcher_class_init (GtkStackSwitcherClass *class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (class);
@@ -486,6 +499,7 @@ gtk_stack_switcher_class_init (GtkStackSwitcherClass *class)
   object_class->get_property = gtk_stack_switcher_get_property;
   object_class->set_property = gtk_stack_switcher_set_property;
   object_class->dispose = gtk_stack_switcher_dispose;
+  object_class->finalize = gtk_stack_switcher_finalize;
 
   g_object_class_install_property (object_class,
                                    PROP_STACK,


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