From c6ce9c1564ab0576754803eba9f0a81499756ebb Mon Sep 17 00:00:00 2001 From: Soeren Sandmann Date: Sun, 13 Jul 2003 19:29:54 +0000 Subject: [PATCH] Fix leaks of label_text, label_widget and icon_widget. (#117312, Christian Sun Jul 13 15:57:57 2003 Soeren Sandmann * gtk/gtktoolbutton.c (gtk_tool_button_finalize): Fix leaks of label_text, label_widget and icon_widget. (#117312, Christian Persch) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtktoolbutton.c | 13 +++++++++++-- 6 files changed, 41 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad0d87b3b9..01d21c9c8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Jul 13 15:57:57 2003 Soeren Sandmann + + * gtk/gtktoolbutton.c (gtk_tool_button_finalize): Fix leaks of + label_text, label_widget and icon_widget. (#117312, + Christian Persch) + Sun Jul 13 01:37:51 2003 Soeren Sandmann * gtk/gtkmenu.c (gtk_menu_class_init): new properties diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ad0d87b3b9..01d21c9c8c 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Sun Jul 13 15:57:57 2003 Soeren Sandmann + + * gtk/gtktoolbutton.c (gtk_tool_button_finalize): Fix leaks of + label_text, label_widget and icon_widget. (#117312, + Christian Persch) + Sun Jul 13 01:37:51 2003 Soeren Sandmann * gtk/gtkmenu.c (gtk_menu_class_init): new properties diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ad0d87b3b9..01d21c9c8c 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Sun Jul 13 15:57:57 2003 Soeren Sandmann + + * gtk/gtktoolbutton.c (gtk_tool_button_finalize): Fix leaks of + label_text, label_widget and icon_widget. (#117312, + Christian Persch) + Sun Jul 13 01:37:51 2003 Soeren Sandmann * gtk/gtkmenu.c (gtk_menu_class_init): new properties diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ad0d87b3b9..01d21c9c8c 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Sun Jul 13 15:57:57 2003 Soeren Sandmann + + * gtk/gtktoolbutton.c (gtk_tool_button_finalize): Fix leaks of + label_text, label_widget and icon_widget. (#117312, + Christian Persch) + Sun Jul 13 01:37:51 2003 Soeren Sandmann * gtk/gtkmenu.c (gtk_menu_class_init): new properties diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ad0d87b3b9..01d21c9c8c 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Sun Jul 13 15:57:57 2003 Soeren Sandmann + + * gtk/gtktoolbutton.c (gtk_tool_button_finalize): Fix leaks of + label_text, label_widget and icon_widget. (#117312, + Christian Persch) + Sun Jul 13 01:37:51 2003 Soeren Sandmann * gtk/gtkmenu.c (gtk_menu_class_init): new properties diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index 27b57e1671..23199edd87 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -501,9 +501,18 @@ gtk_tool_button_finalize (GObject *object) { GtkToolButton *button = GTK_TOOL_BUTTON (object); - g_free (button->priv->stock_id); - button->priv->stock_id = NULL; + if (button->priv->stock_id) + g_free (button->priv->stock_id); + if (button->priv->label_text) + g_free (button->priv->label_text); + + if (button->priv->label_widget) + g_object_unref (G_OBJECT (button->priv->label_widget)); + + if (button->priv->icon_widget) + g_object_unref (G_OBJECT (button->priv->icon_widget)); + parent_class->finalize (object); }