[gimp] Bug 793373 - Crash when ctrl-alt-clicking, dragging then releasing...



commit 68e37f28c2490d6a3a66e20eaa2721b24ce9fc33
Author: Ell <ell_se yahoo com>
Date:   Mon Feb 12 05:03:53 2018 -0500

    Bug 793373 - Crash when ctrl-alt-clicking, dragging then releasing...
    
    ... a selection.
    
    The crash was the result of an unmatched gimp_item_end_move() call,
    which is an error.  Add the matching gimp_item_start_move() call
    when starting to drag a selection in GimpEditSelectionTool.  Revert
    last commit, so that unmatched gimp_layer_end_move() calls are not
    silently ignored, and add a check instead.

 app/core/gimplayer.c              |   30 ++++++++++++++----------------
 app/tools/gimpeditselectiontool.c |    2 ++
 2 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 94783b9..4d11017 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -1090,31 +1090,29 @@ gimp_layer_end_move (GimpItem *item,
                      gboolean  push_undo)
 {
   GimpLayer *layer = GIMP_LAYER (item);
+  GSList    *ancestors;
+  GSList    *iter;
+
+  g_return_if_fail (layer->move_stack != NULL);
 
   if (GIMP_ITEM_CLASS (parent_class)->end_move)
     GIMP_ITEM_CLASS (parent_class)->end_move (item, push_undo);
 
-  if (layer->move_stack)
-    {
-      GSList *ancestors;
-      GSList *iter;
-
-      ancestors = layer->move_stack->data;
-
-      layer->move_stack = g_slist_remove (layer->move_stack, ancestors);
+  ancestors = layer->move_stack->data;
 
-      /* resume mask cropping for all of the layer's ancestors */
-      for (iter = ancestors; iter; iter = g_slist_next (iter))
-        {
-          GimpGroupLayer *ancestor = iter->data;
+  layer->move_stack = g_slist_remove (layer->move_stack, ancestors);
 
-          gimp_group_layer_resume_mask (ancestor, push_undo);
+  /* resume mask cropping for all of the layer's ancestors */
+  for (iter = ancestors; iter; iter = g_slist_next (iter))
+    {
+      GimpGroupLayer *ancestor = iter->data;
 
-          g_object_unref (ancestor);
-        }
+      gimp_group_layer_resume_mask (ancestor, push_undo);
 
-      g_slist_free (ancestors);
+      g_object_unref (ancestor);
     }
+
+  g_slist_free (ancestors);
 }
 
 static void
diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c
index 36d8390..115269c 100644
--- a/app/tools/gimpeditselectiontool.c
+++ b/app/tools/gimpeditselectiontool.c
@@ -600,6 +600,8 @@ gimp_edit_selection_tool_update_motion (GimpEditSelectionTool *edit_select,
 
           edit_select->live_items = g_list_prepend (NULL, active_item);
 
+          gimp_item_start_move (active_item, TRUE);
+
           /*  fallthru  */
 
         case GIMP_TRANSLATE_MODE_FLOATING_SEL:


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