From 008ba4cf32db4a118e28e0e64e62742ca998c5e5 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 5 Feb 2014 12:39:41 +0000 Subject: [PATCH 3/7] McdAccountManager: ref the objects in McdLoadAccountsData --- src/mcd-account-manager.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c index 5703925..593e698 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); } } -- 1.9.rc1