[gimp] app: don't crash the flip tool on each click



commit 785436f32e46f6d5cafb9575effe050e069fce4a
Author: Michael Natterer <mitch gimp org>
Date:   Thu Jun 6 02:08:00 2013 +0200

    app: don't crash the flip tool on each click
    
    Don't push an internal transform tool undo after invoking the flip
    special case of directly transforming on each click, because the
    transform clears the tool state and there is nothing to undo anyway
    (flip is atomic). Additionally, add a precondition check to
    gimp_transform_tool_push_internal_undo().

 app/tools/gimptransformtool.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index a3eef19..35543ad 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -385,6 +385,7 @@ gimp_transform_tool_push_internal_undo (GimpTransformTool *tr_tool)
   gint i;
 
   g_return_if_fail (GIMP_IS_TRANSFORM_TOOL (tr_tool));
+  g_return_if_fail (tr_tool->prev_trans_info != NULL);
 
   /* push current state on the undo list and set this state as the
    * current state, but avoid doing this if there were no changes
@@ -437,6 +438,7 @@ gimp_transform_tool_button_release (GimpTool              *tool,
       if (! tr_tool->use_grid)
         {
           gimp_transform_tool_response (NULL, GTK_RESPONSE_OK, tr_tool);
+          return;
         }
 
       /* We're done with an interaction, save it on the undo list */


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