diff options
author | Timm Bäder <mail@baedert.org> | 2020-02-20 17:54:56 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-02-25 10:43:15 +0100 |
commit | 1b278b0636d710182e4c99f29f9597d0ef3e2115 (patch) | |
tree | d94fba7ad73cf2655eb5b81782f2a5bec1e2d739 /gtk/gtkcolorchooserwidget.c | |
parent | 648a67085f37e42c464dc4d5c498ffc3afed3ecc (diff) | |
download | gtk+-1b278b0636d710182e4c99f29f9597d0ef3e2115.tar.gz |
colorchooserwidget: Get rid of a gtk_widget_destroy() call
Diffstat (limited to 'gtk/gtkcolorchooserwidget.c')
-rw-r--r-- | gtk/gtkcolorchooserwidget.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gtk/gtkcolorchooserwidget.c b/gtk/gtkcolorchooserwidget.c index 269c6a26e8..bda681e7ab 100644 --- a/gtk/gtkcolorchooserwidget.c +++ b/gtk/gtkcolorchooserwidget.c @@ -803,20 +803,16 @@ add_custom_color (GtkColorChooserWidget *cc, const GdkRGBA *color) { GtkColorChooserWidgetPrivate *priv = gtk_color_chooser_widget_get_instance_private (cc); - GtkWidget *last; GtkWidget *p; GList *children; children = gtk_container_get_children (GTK_CONTAINER (priv->custom)); if (g_list_length (children) >= 9) { - last = g_list_last (children)->data; - if (last == GTK_WIDGET (priv->current)) - priv->current = NULL; + GtkWidget *last = gtk_widget_get_last_child (priv->custom); - gtk_widget_destroy (last); + gtk_container_remove (GTK_CONTAINER (priv->custom), last); } - g_list_free (children); p = gtk_color_swatch_new (); |