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-manager.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-manager.c')
-rw-r--r-- | telepathy-glib/connection-manager.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/telepathy-glib/connection-manager.c b/telepathy-glib/connection-manager.c index ae3c006db..b9377b32b 100644 --- a/telepathy-glib/connection-manager.c +++ b/telepathy-glib/connection-manager.c @@ -668,7 +668,7 @@ tp_connection_manager_end_introspection (TpConnectionManager *self, for (i = 0; i < self->priv->pending_protocols->len; i++) g_free (self->priv->pending_protocols->pdata[i]); - g_ptr_array_free (self->priv->pending_protocols, TRUE); + g_ptr_array_unref (self->priv->pending_protocols); self->priv->pending_protocols = NULL; } @@ -686,7 +686,7 @@ tp_connection_manager_update_protocol_structs (TpConnectionManager *self) g_assert (self->priv->protocol_objects != NULL); if (self->priv->protocol_structs != NULL) - g_ptr_array_free (self->priv->protocol_structs, TRUE); + g_ptr_array_unref (self->priv->protocol_structs); self->priv->protocol_structs = g_ptr_array_sized_new ( g_hash_table_size (self->priv->protocol_objects) + 1); @@ -1233,7 +1233,7 @@ tp_connection_manager_dispose (GObject *object) if (self->priv->protocol_structs != NULL) { - g_ptr_array_free (self->priv->protocol_structs, TRUE); + g_ptr_array_unref (self->priv->protocol_structs); self->priv->protocol_structs = NULL; } @@ -1272,7 +1272,7 @@ tp_connection_manager_finalize (GObject *object) for (i = 0; i < self->priv->pending_protocols->len; i++) g_free (self->priv->pending_protocols->pdata[i]); - g_ptr_array_free (self->priv->pending_protocols, TRUE); + g_ptr_array_unref (self->priv->pending_protocols); } G_OBJECT_CLASS (tp_connection_manager_parent_class)->finalize (object); @@ -1704,10 +1704,10 @@ list_context_unref (_ListContext *list_context) g_object_unref (cm); } - g_ptr_array_free (list_context->arr, TRUE); + g_ptr_array_unref (list_context->arr); } - g_hash_table_destroy (list_context->table); + g_hash_table_unref (list_context->table); g_slice_free (_ListContext, list_context); } |