telepathy-mission-control: McdAccountManager: ref the objects in McdLoadAccountsData

Simon McVittie smcv at kemper.freedesktop.org
Thu Feb 6 05:06:51 PST 2014


Module: telepathy-mission-control
Branch: master
Commit: a48f28886f8417dcd10da01cb4e1330e59390119
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=a48f28886f8417dcd10da01cb4e1330e59390119

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed Feb  5 12:39:41 2014 +0000

McdAccountManager: ref the objects in McdLoadAccountsData

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74581
Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>

---

 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);
     }
 }



More information about the telepathy-commits mailing list