diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-10-25 20:27:18 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-10-25 20:30:08 -0400 |
commit | 8b6457732f2c7723b2415bf3dddc734219eeca2e (patch) | |
tree | b660538cb3eb56762bbb37f16213fa2fbb330719 /gtk/gtkbox.c | |
parent | 1376c6b1b70f186e8523b2776af954b765d124de (diff) | |
download | gtk+-8b6457732f2c7723b2415bf3dddc734219eeca2e.tar.gz |
GtkBox: Fix self-assignment for center widget
This is happening when glade is loading ui files containing
center widgets.
Diffstat (limited to 'gtk/gtkbox.c')
-rw-r--r-- | gtk/gtkbox.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 72f26e94cd..2fb1c0d0c7 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -2616,17 +2616,22 @@ gtk_box_set_center_widget (GtkBox *box, GtkWidget *widget) { GtkBoxPrivate *priv = box->priv; + GtkWidget *old_center = NULL; g_return_if_fail (GTK_IS_BOX (box)); if (priv->center) { + old_center = g_object_ref (priv->center->widget); gtk_box_remove (GTK_CONTAINER (box), priv->center->widget); priv->center = NULL; } if (widget) priv->center = gtk_box_pack (box, widget, FALSE, TRUE, 0, GTK_PACK_START); + + if (old_center) + g_object_unref (old_center); } /** |