From 42c485ff56f5425cd592ae73c1c0e6c0f1de2b13 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 11 Jun 2014 10:15:05 +0200 Subject: [PATCH] mcd_account_delete: make sure that the account stays alive Fix a regression introduced when backporting fix for https://bugs.freedesktop.org/show_bug.cgi?id=79827 --- src/mcd-account.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mcd-account.c b/src/mcd-account.c index 48880be..1ed237b 100644 --- a/src/mcd-account.c +++ b/src/mcd-account.c @@ -774,6 +774,10 @@ mcd_account_delete (McdAccount *account, mcd_storage_commit (priv->storage, name); + /* The callback may drop the latest ref on @account so make sure it stays + * alive while we still need it. */ + g_object_ref (account); + if (callback != NULL) callback (account, NULL, user_data); @@ -788,6 +792,7 @@ mcd_account_delete (McdAccount *account, } unregister_dbus_service (account); + g_object_unref (account); } void -- 1.9.3