Unparent the old image before overwriting priv->image. (#437281, Jochen

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
This commit is contained in:
Matthias Clasen 2007-05-10 20:19:38 +00:00 committed by Matthias Clasen
parent 16f9e30bea
commit 75092d295b
2 changed files with 9 additions and 1 deletions

View File

@ -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):

View 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);