[gnome-photos] pipeline: Don't destroy the graph and its proxies when deserializing



commit d9f9f1ce6d30cd3833f0d00bcea5a63b31f672da
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 23 15:08:40 2016 +0100

    pipeline: Don't destroy the graph and its proxies when deserializing
    
    This is important because external code holding references to the graph
    and its proxies will be confused if we destroy them when reverting to
    an earlier snapshot.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762046

 src/photos-pipeline.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-pipeline.c b/src/photos-pipeline.c
index cf4a5ee..e9e38d9 100644
--- a/src/photos-pipeline.c
+++ b/src/photos-pipeline.c
@@ -88,7 +88,6 @@ photos_pipeline_create_graph_from_xml (PhotosPipeline *self, gchar *contents)
   GeglNode *input;
   GeglNode *node;
   GeglNode *output;
-  GeglNode *parent;
   GSList *children = NULL;
   GSList *l;
   gboolean ret_val = FALSE;
@@ -104,12 +103,7 @@ photos_pipeline_create_graph_from_xml (PhotosPipeline *self, gchar *contents)
   if (graph == NULL)
     goto out;
 
-  parent = gegl_node_get_parent (self->graph);
-  g_clear_object (&self->graph);
-
-  self->graph = gegl_node_new ();
-  if (parent != NULL)
-    gegl_node_add_child (parent, self->graph);
+  photos_utils_remove_children_from_node (self->graph);
 
   input = gegl_node_get_input_proxy (self->graph, "input");
   output = gegl_node_get_output_proxy (self->graph, "output");


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