From 5918e2b4d36e54f245aef3c3bc9f53d6285b4ac6 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Sat, 24 May 2025 17:47:34 +0000 Subject: [PATCH] widgets: Prevent crash when changing indexed color Similar logic to 4d8073a3 - the selection signal was not being properly disconnected when the dialogue closed after the color entry's color was changed via the HTML field. This patch switches to using g_signal_connect_object () to automatically disconnect when the object is destroyed. --- app/widgets/gimpcolormapselection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/widgets/gimpcolormapselection.c b/app/widgets/gimpcolormapselection.c index 30aeeec237..923b9b7064 100644 --- a/app/widgets/gimpcolormapselection.c +++ b/app/widgets/gimpcolormapselection.c @@ -836,9 +836,9 @@ gimp_colormap_selection_set_palette (GimpColormapSelection *selection) gint n_colors; n_colors = gimp_palette_get_n_colors (palette); - g_signal_connect_swapped (palette, "dirty", - G_CALLBACK (gtk_widget_queue_draw), - selection); + g_signal_connect_object (palette, "dirty", + G_CALLBACK (gtk_widget_queue_draw), + selection, G_CONNECT_SWAPPED); gimp_view_set_viewable (GIMP_VIEW (selection->view), GIMP_VIEWABLE (palette)); gtk_adjustment_set_upper (selection->index_adjustment, n_colors - 1);