[gtk/focus-adjustment: 2/6] colorchooser: Fix a crash
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/focus-adjustment: 2/6] colorchooser: Fix a crash
- Date: Thu, 16 Apr 2020 21:25:30 +0000 (UTC)
commit e1915072f99c5856ed8cd7d7149a88efb1059aaa
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Apr 16 17:08:31 2020 -0400
colorchooser: Fix a crash
Don't crash when we start removing custom colors
that happen to be currently selected.
gtk/gtkcolorchooserwidget.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtkcolorchooserwidget.c b/gtk/gtkcolorchooserwidget.c
index a6b3c5cc53..5dbb3b1aa4 100644
--- a/gtk/gtkcolorchooserwidget.c
+++ b/gtk/gtkcolorchooserwidget.c
@@ -794,6 +794,9 @@ add_custom_color (GtkColorChooserWidget *cc,
{
GtkWidget *last = gtk_widget_get_last_child (cc->custom);
+ if (last == (GtkWidget *)cc->current)
+ cc->current = NULL;
+
gtk_container_remove (GTK_CONTAINER (cc->custom), last);
}
g_list_free (children);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]