summaryrefslogtreecommitdiff
path: root/json-glib/json-object.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-11-07 18:01:54 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2016-01-28 10:18:56 +0100
commit28c7347150d24383114f06457c3a8d5f5d8eab00 (patch)
treed71778251d492f7df24bbb7485eb55b3491c5ace /json-glib/json-object.c
parentd8720da7ec351e5f15f6ce7baf96434ea42bb111 (diff)
downloadjson-glib-28c7347150d24383114f06457c3a8d5f5d8eab00.tar.gz
core: Remove atomic operations for reference counting
They are not needed — json-glib is not at all thread safe.
Diffstat (limited to 'json-glib/json-object.c')
-rw-r--r--json-glib/json-object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/json-glib/json-object.c b/json-glib/json-object.c
index cc32148..214ffef 100644
--- a/json-glib/json-object.c
+++ b/json-glib/json-object.c
@@ -87,7 +87,7 @@ json_object_ref (JsonObject *object)
g_return_val_if_fail (object != NULL, NULL);
g_return_val_if_fail (object->ref_count > 0, NULL);
- g_atomic_int_add (&object->ref_count, 1);
+ object->ref_count++;
return object;
}
@@ -106,7 +106,7 @@ json_object_unref (JsonObject *object)
g_return_if_fail (object != NULL);
g_return_if_fail (object->ref_count > 0);
- if (g_atomic_int_dec_and_test (&object->ref_count))
+ if (--object->ref_count == 0)
{
g_list_free (object->members_ordered);
g_hash_table_destroy (object->members);