[gimp] app: fix double node insertion to a graphless filter stack



commit 1b0966d964f0bc7bdabc4630b32d99b03aa87022
Author: Ell <ell_se yahoo com>
Date:   Sun Mar 12 20:03:23 2017 -0400

    app: fix double node insertion to a graphless filter stack
    
    When adding an item to a filter stack that doesn't have a graph yet,
    calling gimp_filter_stack_update_last_node() may ultimately lead to
    the invocation of gimp_filter_stack_get_graph(), which would create
    a new graph, and add the item's node to it; gimp_filter_stack_add()
    would then erroneously attempt to re-add the node to the graph.
    
    Fix this by calling gimp_filter_stack_update_last_node() after
    (potentially) adding the node to the graph in
    gimp_filter_stack_add().

 app/core/gimpfilterstack.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpfilterstack.c b/app/core/gimpfilterstack.c
index 50401a1..6aacc26 100644
--- a/app/core/gimpfilterstack.c
+++ b/app/core/gimpfilterstack.c
@@ -114,13 +114,13 @@ gimp_filter_stack_add (GimpContainer *container,
 
   GIMP_CONTAINER_CLASS (parent_class)->add (container, object);
 
-  gimp_filter_stack_update_last_node (stack);
-
   if (stack->graph)
     {
       gegl_node_add_child (stack->graph, gimp_filter_get_node (filter));
       gimp_filter_stack_add_node (stack, filter);
     }
+
+  gimp_filter_stack_update_last_node (stack);
 }
 
 static void


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