From 45e9aa745aec5c9148325d4fdc458d82556d801f Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 13 Jul 2012 01:22:19 +0200 Subject: [PATCH] Fix DBus paths not disappearing when the account is deleted Due to a reference leak in McdAccountManager, McdAccounts were never unregistered from DBus, which caused a crash if a different account was later registered with the same path (for example after goa-daemon restarting). Fix the ref leak, and force disposal of deleted accounts. https://bugs.freedesktop.org/show_bug.cgi?id=51634 --- src/mcd-account-manager.c | 1 + src/mcd-account.c | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c index c71d808..d307508 100644 --- a/src/mcd-account-manager.c +++ b/src/mcd-account-manager.c @@ -311,6 +311,7 @@ async_created_manager_cb (McdManager *cm, const GError *error, gpointer data) * being fired and (potentially) the account going online automatically */ mcd_account_check_validity (account, async_created_validity_cb, NULL); + g_object_unref (account); g_object_unref (cm); } diff --git a/src/mcd-account.c b/src/mcd-account.c index aa04007..3d2ffe1 100644 --- a/src/mcd-account.c +++ b/src/mcd-account.c @@ -777,15 +777,10 @@ mcd_account_delete (McdAccount *account, if (callback != NULL) callback (account, NULL, user_data); - /* If the account was not removed via the DBus Account interface code * - * path and something is holding a ref to it so it does not get disposed, * - * then this signal may not get fired, so we make sure it _does_ here */ - if (!priv->removed) - { - DEBUG ("Forcing Account.Removed for %s", name); - priv->removed = TRUE; - tp_svc_account_emit_removed (account); - } + /* Force disposal of the object, so any holders + will properly release their references, and + associated DBus paths are unregistered */ + g_object_run_dispose (G_OBJECT (account)); } void -- 1.7.10.4