summaryrefslogtreecommitdiff
path: root/src/tube-dbus.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-11-16 15:35:10 +0100
committerXavier Claessens <xclaesse@gmail.com>2011-11-16 15:35:31 +0100
commitb7cfa229c65ecba4d4a5e9e0ea90331e9d5bb269 (patch)
tree8ea475c882ba20c8b42bcc7348c361e8b55ceb54 /src/tube-dbus.c
parent54f726c81670463a8bf16b4cd002d258f03aa05a (diff)
downloadtelepathy-salut-b7cfa229c65ecba4d4a5e9e0ea90331e9d5bb269.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/tube-dbus.c')
-rw-r--r--src/tube-dbus.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tube-dbus.c b/src/tube-dbus.c
index 6513e090..6ed2dec9 100644
--- a/src/tube-dbus.c
+++ b/src/tube-dbus.c
@@ -626,7 +626,7 @@ salut_tube_dbus_dispose (GObject *object)
{
g_hash_table_foreach (priv->dbus_names, unref_handle_foreach,
contact_repo);
- g_hash_table_destroy (priv->dbus_names);
+ g_hash_table_unref (priv->dbus_names);
}
if (priv->muc_connection != NULL)
@@ -655,8 +655,8 @@ salut_tube_dbus_finalize (GObject *object)
g_free (priv->object_path);
g_free (priv->stream_id);
g_free (priv->service);
- g_hash_table_destroy (priv->parameters);
- g_array_free (priv->supported_access_controls, TRUE);
+ g_hash_table_unref (priv->parameters);
+ g_array_unref (priv->supported_access_controls);
G_OBJECT_CLASS (salut_tube_dbus_parent_class)->finalize (object);
}
@@ -886,7 +886,7 @@ salut_tube_dbus_set_property (GObject *object,
break;
case PROP_PARAMETERS:
if (priv->parameters != NULL)
- g_hash_table_destroy (priv->parameters);
+ g_hash_table_unref (priv->parameters);
priv->parameters = g_value_dup_boxed (value);
break;
default:
@@ -1617,8 +1617,8 @@ salut_tube_dbus_add_name (SalutTubeDBus *self,
tp_svc_channel_type_dbus_tube_emit_dbus_names_changed (self, added,
removed);
- g_hash_table_destroy (added);
- g_array_free (removed, TRUE);
+ g_hash_table_unref (added);
+ g_array_unref (removed);
return TRUE;
}
@@ -1651,8 +1651,8 @@ salut_tube_dbus_remove_name (SalutTubeDBus *self,
tp_svc_channel_type_dbus_tube_emit_dbus_names_changed (self, added,
removed);
- g_hash_table_destroy (added);
- g_array_free (removed, TRUE);
+ g_hash_table_unref (added);
+ g_array_unref (removed);
tp_handle_unref (contact_repo, handle);
return TRUE;
}