[gimp/gimp-2-10] Issue #1613 - foreground select tool raises a CRITICAL when committing



commit e486537ce041cf9a0d7fb2a3025c00c3bd6c331c
Author: Ell <ell_se yahoo com>
Date:   Thu Jun 14 19:45:04 2018 -0400

    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.
    
    (cherry picked from commit e15733236c40ac8f5ce46a80f434e3de03e54930)

 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 97ba63d931..c946650adc 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -1025,6 +1025,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__  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]