[telepathy-glib/master] tp_dbus_daemon_release_name: fail gracefully if TpDBusDaemon was invalidated
Simon McVittie
simon.mcvittie at collabora.co.uk
Wed May 27 03:46:50 PDT 2009
---
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 8477c70..092b0e4 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);
--
1.5.6.5
More information about the telepathy-commits
mailing list