]> git.0d.be Git - empathy.git/commitdiff
Use atomic operations to manage EmpathyAdiumData refcount
authorXavier Claessens <xclaesse@gmail.com>
Wed, 8 Jul 2009 15:36:57 +0000 (16:36 +0100)
committerXavier Claessens <xclaesse@gmail.com>
Wed, 8 Jul 2009 15:36:57 +0000 (16:36 +0100)
libempathy-gtk/empathy-theme-adium.c

index 0464a61930daa4e14f8cf5a7453a335c04a0a04b..f37c98841541557f098e631520447f75840dc17b 100644 (file)
@@ -1026,7 +1026,7 @@ empathy_adium_data_ref (EmpathyAdiumData *data)
 {
        g_return_val_if_fail (data != NULL, NULL);
 
-       data->ref_count++;
+       g_atomic_int_inc (&data->ref_count);
 
        return data;
 }
@@ -1036,8 +1036,7 @@ empathy_adium_data_unref (EmpathyAdiumData *data)
 {
        g_return_if_fail (data != NULL);
 
-       data->ref_count--;
-       if (data->ref_count == 0) {
+       if (g_atomic_int_dec_and_test (&data->ref_count)) {
                g_free (data->path);
                g_free (data->basedir);
                g_free (data->template_html);