colorchooserwidgeet: Reset the selected swatch when removing

Otherwise, priv->current points to garbage and subsequently leads to a
crash, e.g. when adding another custom color.
This commit is contained in:
Timm Bäder 2016-01-30 22:31:27 +01:00
parent dd322f715f
commit 16726e31f0

View File

@ -747,6 +747,9 @@ add_custom_color (GtkColorChooserWidget *cc,
if (g_list_length (children) >= 9)
{
last = g_list_last (children)->data;
if (last == GTK_WIDGET (cc->priv->current))
cc->priv->current = NULL;
gtk_widget_destroy (last);
}