From b7cfa229c65ecba4d4a5e9e0ea90331e9d5bb269 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 16 Nov 2011 15:35:10 +0100 Subject: 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/ --- src/olpc-activity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/olpc-activity.c') diff --git a/src/olpc-activity.c b/src/olpc-activity.c index 98d33aef..141783ee 100644 --- a/src/olpc-activity.c +++ b/src/olpc-activity.c @@ -338,7 +338,7 @@ send_properties_change_msg (SalutOlpcActivity *self, g_object_unref (stanza); g_object_unref (muc_connection); g_free (muc_name); - g_hash_table_destroy (properties); + g_hash_table_unref (properties); return result; } @@ -687,7 +687,7 @@ salut_olpc_activity_augment_invitation (SalutOlpcActivity *self, tp_handle_set_add (priv->invited, contact); - g_hash_table_destroy (properties); + g_hash_table_unref (properties); } gboolean -- cgit v1.2.1