diff options
Diffstat (limited to 'axiom')
-rw-r--r-- | axiom/src/om/om_node.c | 12 | ||||
-rw-r--r-- | axiom/src/om/om_stax_builder.c | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/axiom/src/om/om_node.c b/axiom/src/om/om_node.c index eb2a50e..50aac77 100644 --- a/axiom/src/om/om_node.c +++ b/axiom/src/om/om_node.c @@ -189,6 +189,12 @@ axiom_node_free_detached_subtree( } } + /* if the owner of the builder, then free the builder */ + if(om_node->own_builder) + { + axiom_stax_builder_free_internal(om_node->builder, env); + } + AXIS2_FREE(env->allocator, om_node); } @@ -210,12 +216,6 @@ axiom_node_free_tree( /* Detach this node before freeing it and its subtree. */ axiom_node_detach_without_namespaces(om_node, env); - /* if the owner of the builder, then free the builder */ - if(om_node->own_builder) - { - axiom_stax_builder_free_internal(om_node->builder, env); - } - /* Free this node and its subtree */ axiom_node_free_detached_subtree(om_node, env); } diff --git a/axiom/src/om/om_stax_builder.c b/axiom/src/om/om_stax_builder.c index ddd6f0e..c43fd61 100644 --- a/axiom/src/om/om_stax_builder.c +++ b/axiom/src/om/om_stax_builder.c @@ -153,6 +153,10 @@ axiom_stax_builder_free_self( { axiom_node_assume_builder_ownership(om_builder->root_node, env); } + else + { + axiom_stax_builder_free_internal(om_builder, env); + } } /** |