telepathy-mission-control: mcd_account_delete: be primarily responsible for emitting Removed
Simon McVittie
smcv at kemper.freedesktop.org
Thu Jan 30 04:34:40 PST 2014
Module: telepathy-mission-control
Branch: master
Commit: c1dfbed74b450b059bf9cac20a5b485c1656a66d
URL: http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=c1dfbed74b450b059bf9cac20a5b485c1656a66d
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Wed Nov 13 15:56:34 2013 +0000
mcd_account_delete: be primarily responsible for emitting Removed
We still don't get here if disposed early, though.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
---
src/mcd-account.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/mcd-account.c b/src/mcd-account.c
index 752e926..e5763a4 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -762,18 +762,15 @@ mcd_account_delete (McdAccount *account,
mcd_storage_commit (priv->storage, name);
- 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);
+ DEBUG ("emitting Account.Removed for %s", name);
priv->removed = TRUE;
tp_svc_account_emit_removed (account);
}
+
+ if (callback != NULL)
+ callback (account, NULL, user_data);
}
void
@@ -2438,11 +2435,8 @@ account_remove_delete_cb (McdAccount *account, const GError *error,
return;
}
- if (!data->self->priv->removed)
- {
- data->self->priv->removed = TRUE;
- tp_svc_account_emit_removed (data->self);
- }
+ /* mcd_account_delete() is meant to have deleted it */
+ g_warn_if_fail (data->self->priv->removed);
tp_svc_account_return_from_remove (data->context);
@@ -3502,6 +3496,9 @@ _mcd_account_dispose (GObject *object)
if (!self->priv->removed)
{
+ /* this can happen in certain account-creation error paths,
+ * as far as I can see */
+ DEBUG ("Account never emitted Removed, emitting it now");
self->priv->removed = TRUE;
tp_svc_account_emit_removed (self);
}
More information about the telepathy-commits
mailing list