summaryrefslogtreecommitdiff
path: root/json-glib/json-node.c
diff options
context:
space:
mode:
Diffstat (limited to 'json-glib/json-node.c')
-rw-r--r--json-glib/json-node.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/json-glib/json-node.c b/json-glib/json-node.c
index a6898d9..fc12d1f 100644
--- a/json-glib/json-node.c
+++ b/json-glib/json-node.c
@@ -398,9 +398,8 @@ json_node_new (JsonNodeType type)
* json_node_copy:
* @node: a #JsonNode
*
- * Copies @node. If the node contains complex data types, their reference
- * counts are increased, regardless of whether the node is mutable or
- * immutable.
+ * Copies @node. If the node contains complex data types, those will also
+ * be copied.
*
* The copy will be immutable if, and only if, @node is immutable. However,
* there should be no need to copy an immutable node.
@@ -430,11 +429,11 @@ json_node_copy (JsonNode *node)
switch (copy->type)
{
case JSON_NODE_OBJECT:
- copy->data.object = json_node_dup_object (node);
+ copy->data.object = json_object_copy (node->data.object, copy);
break;
case JSON_NODE_ARRAY:
- copy->data.array = json_node_dup_array (node);
+ copy->data.array = json_array_copy (node->data.array, copy);
break;
case JSON_NODE_VALUE: