~ubuntu-branches/ubuntu/oneiric/json-glib/oneiric

« back to all changes in this revision

Viewing changes to json-glib/json-object.c

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2011-06-21 16:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20110621162902-ddd1ue8pgcqbpj6s
Tags: 0.13.4-1
* New upstream release. (Thanks to Ted Gould <ted@ubuntu.com>)
  - Fixes for removal of G_CONST_RETURN
* debian/libjson-glib-1.0-0.symbols: Update for 0.13.4
* debian/watch: Switch to .bz2 tarballs

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
  g_return_val_if_fail (object != NULL, NULL);
90
90
  g_return_val_if_fail (object->ref_count > 0, NULL);
91
91
 
92
 
  g_atomic_int_exchange_and_add (&object->ref_count, 1);
 
92
  g_atomic_int_add (&object->ref_count, 1);
93
93
 
94
94
  return object;
95
95
}
105
105
void
106
106
json_object_unref (JsonObject *object)
107
107
{
108
 
  gint old_ref;
109
 
 
110
108
  g_return_if_fail (object != NULL);
111
109
  g_return_if_fail (object->ref_count > 0);
112
110
 
113
 
  old_ref = g_atomic_int_get (&object->ref_count);
114
 
  if (old_ref > 1)
115
 
    g_atomic_int_compare_and_exchange (&object->ref_count, old_ref, old_ref - 1);
116
 
  else
 
111
  if (g_atomic_int_dec_and_test (&object->ref_count))
117
112
    {
118
113
      g_list_free (object->members_ordered);
119
114
      g_hash_table_destroy (object->members);
674
669
 *
675
670
 * Since: 0.8
676
671
 */
677
 
G_CONST_RETURN gchar *
 
672
const gchar *
678
673
json_object_get_string_member (JsonObject  *object,
679
674
                               const gchar *member_name)
680
675
{