From 3be3d84b6aec64b9e7b50f8ccd52af1433793a4d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 23 Jun 2005 04:24:24 +0000 Subject: [PATCH] Don't trigger warnings if there are extra references to the hbox. 2005-06-23 Matthias Clasen * gtk/gtkbutton.c (gtk_button_construct_child): Don't trigger warnings if there are extra references to the hbox. (#308677, Dan Winship) --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ gtk/gtkbutton.c | 6 +++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5ef1363f07..352c4f6b25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-06-23 Matthias Clasen + * gtk/gtkbutton.c (gtk_button_construct_child): Don't + trigger warnings if there are extra references to the + hbox. (#308677, Dan Winship) + * gtk/gtkfilesystemunix.c (bookmark_list_write): Use g_file_set_contents(). (#308722, Morten Welinder) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5ef1363f07..352c4f6b25 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2005-06-23 Matthias Clasen + * gtk/gtkbutton.c (gtk_button_construct_child): Don't + trigger warnings if there are extra references to the + hbox. (#308677, Dan Winship) + * gtk/gtkfilesystemunix.c (bookmark_list_write): Use g_file_set_contents(). (#308722, Morten Welinder) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5ef1363f07..352c4f6b25 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,9 @@ 2005-06-23 Matthias Clasen + * gtk/gtkbutton.c (gtk_button_construct_child): Don't + trigger warnings if there are extra references to the + hbox. (#308677, Dan Winship) + * gtk/gtkfilesystemunix.c (bookmark_list_write): Use g_file_set_contents(). (#308722, Morten Welinder) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 3a9f2a451a..8190ad8fa2 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -687,7 +687,11 @@ gtk_button_construct_child (GtkButton *button) if (GTK_BIN (button)->child) { if (priv->image && !priv->image_is_stock) - image = g_object_ref (priv->image); + { + image = g_object_ref (priv->image); + if (image->parent) + gtk_container_remove (GTK_CONTAINER (image->parent), image); + } gtk_container_remove (GTK_CONTAINER (button), GTK_BIN (button)->child);