diff options
-rw-r--r-- | mission-control-plugins/debug.h | 2 | ||||
-rw-r--r-- | src/mcd-account.c | 30 |
2 files changed, 27 insertions, 5 deletions
diff --git a/mission-control-plugins/debug.h b/mission-control-plugins/debug.h index a5c61c00..8d3cec87 100644 --- a/mission-control-plugins/debug.h +++ b/mission-control-plugins/debug.h @@ -27,7 +27,7 @@ #define MCP_DEBUG(_type, _fmt, ...) \ G_STMT_START { if (mcp_is_debugging (_type)) \ - g_debug ("%s: " _fmt, G_STRLOC, ##__VA_ARGS__); } G_STMT_END + g_debug ("%s: " _fmt, G_STRFUNC, ##__VA_ARGS__); } G_STMT_END G_BEGIN_DECLS 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; + } } /* |