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/base-connection-manager.c | |
parent | e6d8b4c7531688cd2dbd3c9bbd8a6c224123de05 (diff) |
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/base-connection-manager.c')
-rw-r--r-- | telepathy-glib/base-connection-manager.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/telepathy-glib/base-connection-manager.c b/telepathy-glib/base-connection-manager.c index 96790ebf0..5c314c5a1 100644 --- a/telepathy-glib/base-connection-manager.c +++ b/telepathy-glib/base-connection-manager.c @@ -313,7 +313,7 @@ tp_base_connection_manager_dispose (GObject *object) if (priv->protocols != NULL) { - g_hash_table_destroy (priv->protocols); + g_hash_table_unref (priv->protocols); priv->protocols = NULL; } @@ -327,7 +327,7 @@ tp_base_connection_manager_finalize (GObject *object) TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (object); TpBaseConnectionManagerPrivate *priv = self->priv; - g_hash_table_destroy (priv->connections); + g_hash_table_unref (priv->connections); G_OBJECT_CLASS (tp_base_connection_manager_parent_class)->finalize (object); } @@ -774,7 +774,7 @@ tp_cm_param_setter_offset (const TpCMParamSpec *paramspec, if (*save_to != NULL) { - g_array_free (*save_to, TRUE); + g_array_unref (*save_to); } *save_to = g_value_dup_boxed (value); DEBUG ("%s = ...[%u]", paramspec->name, (*save_to)->len); @@ -901,7 +901,7 @@ tp_base_connection_manager_get_parameters (TpSvcConnectionManager *iface, g_value_array_free (g_ptr_array_index (ret, i)); } - g_ptr_array_free (ret, TRUE); + g_ptr_array_unref (ret); } @@ -937,7 +937,7 @@ tp_base_connection_manager_list_protocols (TpSvcConnectionManager *iface, tp_svc_connection_manager_return_from_list_protocols ( context, (const gchar **) protocols->pdata); - g_ptr_array_free (protocols, TRUE); + g_ptr_array_unref (protocols); } |