[gimp] app: Fix merging floating selections when undo is diabled.



commit cff668f8767b832224f558d19d9865bbd266845e
Author: Michael Henning <drawoc darkrefraction com>
Date:   Sat Aug 10 13:43:12 2013 -0400

    app: Fix merging floating selections when undo is diabled.

 app/core/gimplayer-floating-sel.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimplayer-floating-sel.c b/app/core/gimplayer-floating-sel.c
index f0dd629..43de643 100644
--- a/app/core/gimplayer-floating-sel.c
+++ b/app/core/gimplayer-floating-sel.c
@@ -87,6 +87,9 @@ floating_sel_anchor (GimpLayer *layer)
   g_return_if_fail (GIMP_IS_LAYER (layer));
   g_return_if_fail (gimp_layer_is_floating_sel (layer));
 
+  /* Don't let gimp_image_remove_layer free the layer while we still need it */
+  g_object_ref (layer);
+
   image = gimp_item_get_image (GIMP_ITEM (layer));
 
   gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_FS_ANCHOR,
@@ -125,6 +128,8 @@ floating_sel_anchor (GimpLayer *layer)
 
   /*  invalidate the boundaries  */
   gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (gimp_image_get_mask (image)));
+
+  g_object_unref (layer);
 }
 
 gboolean


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