diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2009-07-08 23:36:57 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2009-07-08 23:36:57 +0800 |
commit | aff75bcc97abac0173dfd4cc6f9a959fbd493ae6 (patch) | |
tree | 8934a136b50541a33edcaa18b6caaadd43ff42af /libempathy-gtk | |
parent | d19d09875e8cf3d77bc464c07d2bb70354b9ae50 (diff) | |
download | gsoc2013-empathy-aff75bcc97abac0173dfd4cc6f9a959fbd493ae6.tar gsoc2013-empathy-aff75bcc97abac0173dfd4cc6f9a959fbd493ae6.tar.gz gsoc2013-empathy-aff75bcc97abac0173dfd4cc6f9a959fbd493ae6.tar.bz2 gsoc2013-empathy-aff75bcc97abac0173dfd4cc6f9a959fbd493ae6.tar.lz gsoc2013-empathy-aff75bcc97abac0173dfd4cc6f9a959fbd493ae6.tar.xz gsoc2013-empathy-aff75bcc97abac0173dfd4cc6f9a959fbd493ae6.tar.zst gsoc2013-empathy-aff75bcc97abac0173dfd4cc6f9a959fbd493ae6.zip |
Use atomic operations to manage EmpathyAdiumData refcount
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-theme-adium.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index 0464a6193..f37c98841 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -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); |