]> Pileus Git - ~andy/gtk/commitdiff
Unparent the old image before overwriting priv->image. (#437281, Jochen
authorMatthias Clasen <mclasen@redhat.com>
Thu, 10 May 2007 20:19:38 +0000 (20:19 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 10 May 2007 20:19:38 +0000 (20:19 +0000)
2007-05-10  Matthias Clasen <mclasen@redhat.com>

        * gtk/gtkbutton.c (gtk_button_set_image): Unparent the old
        image before overwriting priv->image.  (#437281, Jochen Baier)

svn path=/trunk/; revision=17816

ChangeLog
gtk/gtkbutton.c

index f17b93b3b91cd90fe7ff95cb7c481d8967c9efb9..2e9e110a792ec91b0cb7cfd5eb5b83c978fa86d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-10  Matthias Clasen <mclasen@redhat.com>
+
+       * gtk/gtkbutton.c (gtk_button_set_image): Unparent the old
+       image before overwriting priv->image.  (#437281, Jochen Baier)
+
 2007-05-10  Matthias Clasen <mclasen@redhat.com>
 
        * gtk/gtkscrolledwindow.c (gtk_scrolled_window_scroll_child):
index 2b0ad37c002258b772f07717346f835b2e01c4ed..c2729c043278253a0353f06d4434e855510e368c 100644 (file)
@@ -733,7 +733,7 @@ gtk_button_construct_child (GtkButton *button)
       image = g_object_ref (priv->image);
       if (image->parent)
        gtk_container_remove (GTK_CONTAINER (image->parent), image);
-      
+
       priv->image = NULL;
     }
   
@@ -1970,6 +1970,9 @@ gtk_button_set_image (GtkButton *button,
 
   priv = GTK_BUTTON_GET_PRIVATE (button);
 
+  if (priv->image && priv->image->parent)
+    gtk_container_remove (GTK_CONTAINER (priv->image->parent), priv->image);
+
   priv->image = image;
   priv->image_is_stock = (image == NULL);