[telepathy-mission-control/master] McdAccount: set_parameter: ref the account across the gnome-keyring call

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Sep 16 11:07:40 PDT 2009


Otherwise, the account won't necessarily still be there when we return...
---
 src/mcd-account.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mcd-account.c b/src/mcd-account.c
index 7e005c5..4c6ab3b 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -578,6 +578,7 @@ keyring_set_cb (GnomeKeyringResult result,
         g_error_free (error);
 
     g_free (data->name);
+    g_object_unref (data->account);
     g_slice_free (KeyringSetData, data);
 }
 #endif
@@ -607,7 +608,7 @@ set_parameter (McdAccount *account, const gchar *name, const GValue *value,
             KeyringSetData *data;
 
             data = g_slice_new0 (KeyringSetData);
-            data->account = account;
+            data->account = g_object_ref (account);
             data->name = g_strdup (name);
             data->callback = callback;
             data->user_data = user_data;
-- 
1.5.6.5




More information about the telepathy-commits mailing list