Unparent child widgets

This commit is contained in:
Timm Bäder 2017-01-07 15:58:55 +01:00
parent 5f98597a0c
commit f486805ba0
2 changed files with 8 additions and 0 deletions

View File

@ -902,6 +902,9 @@ gtk_spin_button_finalize (GObject *object)
g_object_unref (priv->up_click_gesture);
g_object_unref (priv->down_click_gesture);
gtk_widget_unparent (priv->up_button);
gtk_widget_unparent (priv->down_button);
G_OBJECT_CLASS (gtk_spin_button_parent_class)->finalize (object);
}

View File

@ -679,8 +679,13 @@ gtk_switch_dispose (GObject *object)
static void
gtk_switch_finalize (GObject *object)
{
GtkSwitchPrivate *priv = GTK_SWITCH (object)->priv;
gtk_switch_end_toggle_animation (GTK_SWITCH (object));
gtk_widget_unparent (priv->on_label);
gtk_widget_unparent (priv->off_label);
G_OBJECT_CLASS (gtk_switch_parent_class)->finalize (object);
}