summaryrefslogtreecommitdiff
path: root/src/mcd-account.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mcd-account.c')
-rw-r--r--src/mcd-account.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/mcd-account.c b/src/mcd-account.c
index 1b2544df..d53c74b2 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -107,6 +107,7 @@ struct _McdAccountPrivate
McdStorage *storage;
TpDBusDaemon *dbus_daemon;
+ gboolean registered;
McdConnectivityMonitor *connectivity;
McdAccountConnectionContext *connection_context;
@@ -562,6 +563,22 @@ get_old_account_data_path (McdAccountPrivate *priv)
static TpStorageRestrictionFlags mcd_account_get_storage_restrictions (
McdAccount *account);
+static void
+unregister_dbus_service (McdAccount *self)
+{
+ DBusGConnection *dbus_connection;
+
+ g_return_if_fail (MCD_IS_ACCOUNT (self));
+
+ if (!self->priv->registered)
+ return;
+
+ dbus_connection = tp_proxy_get_dbus_connection (self->priv->dbus_daemon);
+ dbus_g_connection_unregister_g_object (dbus_connection, (GObject *) self);
+
+ self->priv->registered = FALSE;
+}
+
void
mcd_account_delete_async (McdAccount *account,
McdDBusPropSetFlags flags,
@@ -638,6 +655,8 @@ mcd_account_delete_async (McdAccount *account,
tp_svc_account_emit_removed (account);
}
+ unregister_dbus_service (account);
+
g_task_return_boolean (task, TRUE);
g_object_unref (task);
}
@@ -2781,10 +2800,13 @@ register_dbus_service (McdAccount *self,
dbus_connection = tp_proxy_get_dbus_connection (TP_PROXY (dbus_daemon));
- if (G_LIKELY (dbus_connection))
- dbus_g_connection_register_g_object (dbus_connection,
- self->priv->object_path,
- (GObject *) self);
+ if (G_LIKELY (dbus_connection)) {
+ dbus_g_connection_register_g_object (dbus_connection,
+ self->priv->object_path,
+ (GObject *) self);
+
+ self->priv->registered = TRUE;
+ }
}
/*