From e15733236c40ac8f5ce46a80f434e3de03e54930 Mon Sep 17 00:00:00 2001 From: Ell Date: Thu, 14 Jun 2018 19:45:04 -0400 Subject: [PATCH] Issue #1613 - foreground select tool raises a CRITICAL when committing Make gimp_free_select_tool_halt() protected, and call it in gimp_foreground_select_tool_set_trimap(), so that the free-select subobject of the foreground-select tool is properly shut down before switching to trimap mode. In particular, this clears the free-select tool widget at the right point; failing to do this leads to CRITICALs later on. --- app/tools/gimpforegroundselecttool.c | 2 ++ app/tools/gimpfreeselecttool.c | 2 +- app/tools/gimpfreeselecttool.h | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c index bce91a84ca..efc163cf9a 100644 --- a/app/tools/gimpforegroundselecttool.c +++ b/app/tools/gimpforegroundselecttool.c @@ -1024,6 +1024,8 @@ gimp_foreground_select_tool_set_trimap (GimpForegroundSelectTool *fg_select) options = GIMP_FOREGROUND_SELECT_TOOL_GET_OPTIONS (tool); + gimp_free_select_tool_halt (GIMP_FREE_SELECT_TOOL (fg_select)); + gimp_foreground_select_options_get_mask_color (options, &color); gimp_display_shell_set_mask (gimp_display_get_shell (tool->display), fg_select->trimap, 0, 0, &color, TRUE); diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c index 3ecfcfb2d3..7832929868 100644 --- a/app/tools/gimpfreeselecttool.c +++ b/app/tools/gimpfreeselecttool.c @@ -233,7 +233,7 @@ gimp_free_select_tool_start (GimpFreeSelectTool *fst, gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display); } -static void +void gimp_free_select_tool_halt (GimpFreeSelectTool *fst) { GimpFreeSelectToolPrivate *private = fst->private; diff --git a/app/tools/gimpfreeselecttool.h b/app/tools/gimpfreeselecttool.h index cfefd76ef3..bd91866513 100644 --- a/app/tools/gimpfreeselecttool.h +++ b/app/tools/gimpfreeselecttool.h @@ -61,5 +61,9 @@ GType gimp_free_select_tool_get_type (void) G_GNUC_CONST; gint gimp_free_select_tool_get_n_points (GimpFreeSelectTool *tool); +/* protected functions */ + +void gimp_free_select_tool_halt (GimpFreeSelectTool *tool); + #endif /* __GIMP_FREE_SELECT_TOOL_H__ */