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.
This commit is contained in:
Ell 2018-06-14 19:45:04 -04:00
parent 47b7e7be7d
commit e15733236c
3 changed files with 7 additions and 1 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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__ */