[gegl] node: disconnect node edges before replacing operation object
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] node: disconnect node edges before replacing operation object
- Date: Mon, 15 May 2017 21:27:39 +0000 (UTC)
commit a273733acfd006b979673a44a2f98aa31a788318
Author: Ell <ell_se yahoo com>
Date: Mon May 15 16:21:18 2017 -0400
node: disconnect node edges before replacing operation object
When setting a node's operation object, disconnect existing edges
while node->operation still points to the previous object.
Otherwise, signal handlers that get called during edge removal may
see the node in an intermediate state.
gegl/graph/gegl-node.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index 45d4477..4f2488a 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -1247,11 +1247,6 @@ gegl_node_set_operation_object (GeglNode *self,
g_return_if_fail (GEGL_IS_OPERATION (operation));
- if (self->operation)
- g_object_unref (self->operation);
-
- self->operation = g_object_ref (operation);
-
if (gegl_node_has_pad (self, "output"))
gegl_node_get_consumers (self, "output", &consumer_nodes, &consumer_names);
@@ -1262,6 +1257,11 @@ gegl_node_set_operation_object (GeglNode *self,
gegl_node_disconnect_sources (self);
gegl_node_disconnect_sinks (self);
+ if (self->operation)
+ g_object_unref (self->operation);
+
+ self->operation = g_object_ref (operation);
+
/* Delete all the pads from the previous operation */
while (self->pads)
gegl_node_remove_pad (self, self->pads->data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]