]> Pileus Git - ~andy/gtk/commitdiff
gtkbox: avoid warning when removing a widget with refcount of 1
authorLionel Landwerlin <lionel.g.landwerlin@linux.intel.com>
Thu, 16 Feb 2012 01:36:06 +0000 (01:36 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 18 Mar 2012 19:41:07 +0000 (15:41 -0400)
If gtkbox is the only object having a reference on one of its child
and that we try to remove it from its container, we endup having a
warning when disconnecting a signal after having unparented the
widget.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=670176

gtk/gtkbox.c

index 7d85ba0eea569481e185f97fd14716d45330fed4..1705645a53b7351c1e47e1ed70007d2f6179de4b 100644 (file)
@@ -1807,13 +1807,13 @@ gtk_box_remove (GtkContainer *container,
        {
          gboolean was_visible;
 
-         was_visible = gtk_widget_get_visible (widget);
-         gtk_widget_unparent (widget);
-
           g_signal_handlers_disconnect_by_func (widget,
                                                 box_child_visibility_notify_cb,
                                                 box);
 
+         was_visible = gtk_widget_get_visible (widget);
+         gtk_widget_unparent (widget);
+
          priv->children = g_list_remove_link (priv->children, children);
          g_list_free (children);
          g_free (child);