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/connection.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/connection.c')
-rw-r--r-- | telepathy-glib/connection.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index 728d4b96d..59fd7f1b0 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -1488,7 +1488,7 @@ tp_connection_finalize (GObject *object) if (self->priv->contact_attribute_interfaces != NULL) { - g_array_free (self->priv->contact_attribute_interfaces, TRUE); + g_array_unref (self->priv->contact_attribute_interfaces); self->priv->contact_attribute_interfaces = NULL; } @@ -1503,7 +1503,7 @@ tp_connection_finalize (GObject *object) if (self->priv->avatar_request_queue != NULL) { - g_array_free (self->priv->avatar_request_queue, TRUE); + g_array_unref (self->priv->avatar_request_queue); self->priv->avatar_request_queue = NULL; } @@ -1558,7 +1558,7 @@ tp_connection_dispose (GObject *object) { g_hash_table_foreach (self->priv->contacts, contact_notify_invalidated, NULL); - tp_clear_pointer (&self->priv->contacts, g_hash_table_destroy); + tp_clear_pointer (&self->priv->contacts, g_hash_table_unref); } tp_clear_object (&self->priv->capabilities); @@ -2823,7 +2823,7 @@ tp_list_connection_names_helper (TpDBusDaemon *bus_daemon, (const gchar * const *) protocols->pdata, NULL, list_context->user_data, user_object); - g_ptr_array_free (bus_names, TRUE); + g_ptr_array_unref (bus_names); g_strfreev ((char **) g_ptr_array_free (cms, FALSE)); g_strfreev ((char **) g_ptr_array_free (protocols, FALSE)); } |