summaryrefslogtreecommitdiff
path: root/goa-mc-plugin
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-11-16 15:31:29 +0100
committerXavier Claessens <xclaesse@gmail.com>2011-11-16 15:57:00 +0100
commit5bb2c1c62a06e682ab48d530cae5f9614a90a75e (patch)
treea847e5c1980d69126b8d7974808cb70923becb33 /goa-mc-plugin
parentba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80 (diff)
downloadempathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.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 'goa-mc-plugin')
-rw-r--r--goa-mc-plugin/mcp-account-manager-goa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/goa-mc-plugin/mcp-account-manager-goa.c b/goa-mc-plugin/mcp-account-manager-goa.c
index 1185d7ba3..fd3942eaf 100644
--- a/goa-mc-plugin/mcp-account-manager-goa.c
+++ b/goa-mc-plugin/mcp-account-manager-goa.c
@@ -82,7 +82,7 @@ mcp_account_manager_goa_finalize (GObject *self)
{
McpAccountManagerGoaPrivate *priv = GET_PRIVATE (self);
- g_hash_table_destroy (priv->accounts);
+ g_hash_table_unref (priv->accounts);
g_key_file_free (priv->store);
g_free (priv->filename);
@@ -150,7 +150,7 @@ get_tp_parameters (GoaAccount *account)
else
{
DEBUG ("Unknown account type %s", type);
- g_hash_table_destroy (params);
+ g_hash_table_unref (params);
return NULL;
}
@@ -179,7 +179,7 @@ get_tp_account_name (GoaAccount *account)
(char *) g_hash_table_lookup (params, "protocol"),
type, id);
- g_hash_table_destroy (params);
+ g_hash_table_unref (params);
return name;
}
@@ -399,7 +399,7 @@ mcp_account_manager_goa_get (const McpAccountStorage *self,
while (g_hash_table_iter_next (&iter, &key, &value))
mcp_account_manager_set_value (am, acct, key, value);
- g_hash_table_destroy (params);
+ g_hash_table_unref (params);
/* Stored properties */
keys = g_key_file_get_keys (priv->store, acct, &nkeys, NULL);
@@ -439,7 +439,7 @@ mcp_account_manager_goa_get (const McpAccountStorage *self,
mcp_account_manager_set_value (am, acct, key, value);
- g_hash_table_destroy (params);
+ g_hash_table_unref (params);
g_free (value);
}