diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 14:39:30 +0100 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 15:56:47 +0100 |
commit | 769a97c2ed9e6cbfda656a65483f6142423adc36 (patch) | |
tree | 2fd5a84dd6c4a41d4e4e61d37780d65a630fa72f /src/muc-channel.c | |
parent | dfccd984ac6c694a689c1f224efb4f4e2b27e01c (diff) | |
download | telepathy-gabble-769a97c2ed9e6cbfda656a65483f6142423adc36.tar.gz |
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 'src/muc-channel.c')
-rw-r--r-- | src/muc-channel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/muc-channel.c b/src/muc-channel.c index 09666cd6a..48a006b35 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -519,7 +519,7 @@ gabble_muc_channel_constructed (GObject *obj) g_array_append_val (members, self_handle); tp_group_mixin_add_members (obj, members, "", &error); g_assert (error == NULL); - g_array_free (members, TRUE); + g_array_unref (members); } tp_handle_unref (contact_handles, self_handle); @@ -1509,7 +1509,7 @@ close_channel (GabbleMucChannel *chan, const gchar *reason, handles = tp_handle_set_to_array (chan->group.members); gabble_presence_cache_update_many (conn->presence_cache, handles, NULL, GABBLE_PRESENCE_UNKNOWN, NULL, 0); - g_array_free (handles, TRUE); + g_array_unref (handles); if (priv->set_subject_context != NULL) return_from_set_subject (chan, &error); @@ -2944,7 +2944,7 @@ gabble_muc_channel_add_member (GObject *obj, tp_intset_add (set_remove_members, g_array_index (arr_members, guint, 0)); } - g_array_free (arr_members, TRUE); + g_array_unref (arr_members); tp_intset_add (set_remote_pending, handle); |