diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 22:31:29 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 22:57:00 +0800 |
commit | 5bb2c1c62a06e682ab48d530cae5f9614a90a75e (patch) | |
tree | a847e5c1980d69126b8d7974808cb70923becb33 /libempathy/empathy-tp-contact-list.c | |
parent | ba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80 (diff) | |
download | gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.gz gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.bz2 gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.lz gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.xz gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.zst gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.zip |
Use _unref instead of _free _destroy when possible.unref
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 'libempathy/empathy-tp-contact-list.c')
-rw-r--r-- | libempathy/empathy-tp-contact-list.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c index bf639e4ce..055154564 100644 --- a/libempathy/empathy-tp-contact-list.c +++ b/libempathy/empathy-tp-contact-list.c @@ -273,7 +273,7 @@ tp_contact_list_group_ready_cb (TpChannel *channel, g_assert (members != NULL); arr = tp_intset_to_array (members); contacts_added_to_group (list, channel, arr); - g_array_free (arr, TRUE); + g_array_unref (arr); } static void @@ -354,7 +354,7 @@ tp_contact_list_group_add (EmpathyTpContactList *list, if (channel) { tp_cli_channel_interface_group_call_add_members (channel, -1, handles, NULL, NULL, NULL, NULL, NULL); - g_array_free (handles, TRUE); + g_array_unref (handles); return; } @@ -434,7 +434,7 @@ add_to_members (EmpathyTpContactList *list, got_added_members_cb, NULL, NULL, G_OBJECT (list)); } - g_array_free (request, TRUE); + g_array_unref (request); } static void @@ -684,7 +684,7 @@ tp_contact_list_subscribe_group_members_changed_cb (TpChannel *channel, tp_cli_channel_interface_group_call_add_members (priv->publish, -1, accept, NULL, NULL, NULL, NULL, NULL); - g_array_free (accept, TRUE); + g_array_unref (accept); } static void @@ -740,10 +740,10 @@ tp_contact_list_finalize (GObject *object) tp_contact_list_group_invalidated_cb, list); } - g_hash_table_destroy (priv->groups); - g_hash_table_destroy (priv->members); - g_hash_table_destroy (priv->pendings); - g_hash_table_destroy (priv->add_to_group); + g_hash_table_unref (priv->groups); + g_hash_table_unref (priv->members); + g_hash_table_unref (priv->pendings); + g_hash_table_unref (priv->add_to_group); G_OBJECT_CLASS (empathy_tp_contact_list_parent_class)->finalize (object); } @@ -1016,7 +1016,7 @@ empathy_tp_contact_list_class_init (EmpathyTpContactListClass *klass) static void tp_contact_list_array_free (gpointer handles) { - g_array_free (handles, TRUE); + g_array_unref (handles); } static void @@ -1281,7 +1281,7 @@ tp_contact_list_remove_group (EmpathyContactList *list, tp_cli_channel_interface_group_call_remove_members (channel, -1, handles, NULL, NULL, NULL, NULL, NULL); tp_cli_channel_call_close (channel, -1, NULL, NULL, NULL, NULL); - g_array_free (handles, TRUE); + g_array_unref (handles); } static EmpathyContactListFlags |