summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-02-05 12:39:41 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-02-06 13:06:20 +0000
commita48f28886f8417dcd10da01cb4e1330e59390119 (patch)
treee0ff9c3fc53d2e1c4dffeb076b32bd510b4e9131
parent77e52ce80eb8705a039b7070515b89efb48863a5 (diff)
McdAccountManager: ref the objects in McdLoadAccountsData
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74581 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r--src/mcd-account-manager.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index 57039253..593e6989 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -292,10 +292,10 @@ created_cb (GObject *storage_plugin_obj,
g_assert (MCD_IS_ACCOUNT (account));
lad = g_slice_new (McdLoadAccountsData);
- lad->account_manager = am;
- lad->storage_plugin = plugin;
+ lad->account_manager = g_object_ref (am);
+ lad->storage_plugin = g_object_ref (plugin);
lad->account_lock = 1; /* released at the end of this function */
- lad->account = account;
+ lad->account = g_object_ref (account);
}
else
{
@@ -1132,6 +1132,10 @@ release_load_accounts_lock (McdLoadAccountsData *lad)
if (lad->account_lock == 0)
{
+ g_object_unref (lad->account_manager);
+ g_object_unref (lad->storage_plugin);
+ g_object_unref (lad->account);
+
g_slice_free (McdLoadAccountsData, lad);
}
}