diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-05-27 11:46:50 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-05-27 11:46:50 +0100 |
commit | 4aa7142b7576f958fe0d2b3ced4bd33b51146c64 (patch) | |
tree | 3e4bfeb2bb49cb62f82cb939049f0a98c95fa186 /telepathy-glib/dbus.c | |
parent | a4a5b752c091783140366697080e5057657d8432 (diff) | |
download | telepathy-glib-4aa7142b7576f958fe0d2b3ced4bd33b51146c64.tar.gz |
tp_dbus_daemon_release_name: fail gracefully if TpDBusDaemon was invalidated
Diffstat (limited to 'telepathy-glib/dbus.c')
-rw-r--r-- | telepathy-glib/dbus.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/telepathy-glib/dbus.c b/telepathy-glib/dbus.c index 8477c70ca..092b0e4b6 100644 --- a/telepathy-glib/dbus.c +++ b/telepathy-glib/dbus.c @@ -1143,15 +1143,29 @@ tp_dbus_daemon_release_name (TpDBusDaemon *self, GError **error) { TpProxy *as_proxy = (TpProxy *) self; - DBusGConnection *gconn = as_proxy->dbus_connection; - DBusConnection *dbc = dbus_g_connection_get_connection (gconn); + DBusGConnection *gconn; + DBusConnection *dbc; DBusError dbus_error; int result; + const GError *invalidated; g_return_val_if_fail (TP_IS_DBUS_DAEMON (self), FALSE); g_return_val_if_fail (tp_dbus_check_valid_bus_name (well_known_name, TP_DBUS_NAME_TYPE_WELL_KNOWN, error), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + invalidated = tp_proxy_get_invalidated (self); + + if (invalidated != NULL) + { + if (error != NULL) + *error = g_error_copy (invalidated); + + return FALSE; + } + + gconn = as_proxy->dbus_connection; + dbc = dbus_g_connection_get_connection (gconn); dbus_error_init (&dbus_error); result = dbus_bus_release_name (dbc, well_known_name, &dbus_error); |