diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 14:08:45 +0100 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 14:36:51 +0100 |
commit | 67bffca0678d1286d07b1531f6562126e92cc31e (patch) | |
tree | 309fa93328b63d8c1a90432bc1c697b4a97beba0 /telepathy-glib/base-contact-list.c | |
parent | e6d8b4c7531688cd2dbd3c9bbd8a6c224123de05 (diff) | |
download | telepathy-glib-67bffca0678d1286d07b1531f6562126e92cc31e.tar.gz |
Use _unref instead of _free _destroy when possible.
Replace g_(ptr_)array_free (foo, TRUE) and g_hash_table_destroy
with respectively g_(ptr_)array_unref (foo) and g_hash_table_unref.
I used this command to generate this patch:
for f in `find -name "*.c"`; do sed -i $f -re 's/g_ptr_array_free \(([^ ,]+), TRUE\)/g_ptr_array_unref \(\1\)/'; done
See Danielle's blog for explanation of possible bug _free can do:
http://blogs.gnome.org/danni/2011/11/16/mistakes-with-g_value_set_boxed/
Diffstat (limited to 'telepathy-glib/base-contact-list.c')
-rw-r--r-- | telepathy-glib/base-contact-list.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c index a1b4e1f3b..d9d6f34ee 100644 --- a/telepathy-glib/base-contact-list.c +++ b/telepathy-glib/base-contact-list.c @@ -548,7 +548,7 @@ tp_base_contact_list_fail_channel_requests (TpBaseContactList *self, g_hash_table_iter_steal (&iter); } - g_hash_table_destroy (tmp); + g_hash_table_unref (tmp); } } @@ -989,7 +989,7 @@ tp_base_contact_list_type_foreach_channel_class (GType type, func (type, table, allowed_properties, user_data); } - g_hash_table_destroy (table); + g_hash_table_unref (table); } static void @@ -4731,7 +4731,7 @@ tp_base_contact_list_mixin_get_contact_list_attributes ( tp_svc_connection_interface_contact_list_return_from_get_contact_list_attributes ( context, result); - g_array_free (contacts, TRUE); + g_array_unref (contacts); tp_handle_set_destroy (set); g_free (sender); g_hash_table_unref (result); |