tp_base_client_register() takes a bus name and registers the Client on D-Bus. However, having done this, there's no way to revoke it. Relatedly, dispose() does not release the bus name (although dbus-glib will remove the TpBaseClient from the object path automatically), which makes this a bug rather than merely a missing feature. I propose this API: /** * tp_base_client_unregister: * @self: a client, which may already have been registered with * tp_base_client_register(), or not * * Remove this client object from D-Bus, if tp_base_client_register() * has already been called. * * If the object is not registered, this method may be called, but has * no effect. * * Releasing the last reference to the object also has the same effect * as calling this method, but this method should be preferred, as it * has more deterministic behaviour. * * If the object still exists, tp_base_client_register() may be used to * attempt to register it again. */ void tp_base_client_unregister (TpBaseClient *self);
Done in my base-handler branch: http://git.collabora.co.uk/?p=user/cassidy/telepathy-glib;a=commitdiff;h=114b7806df881e09b2d819acab7c5449615cf81d http://git.collabora.co.uk/?p=user/cassidy/telepathy-glib;a=commitdiff;h=7e602baaec803c1d7b009b1ea8e51f2939e71508
+ if (!tp_dbus_daemon_release_name (self->priv->dbus, self->priv->bus_name, + &error)) + { + ERROR ("Failed to release bus name (%s): %s", self->priv->bus_name, + error->message); I'd make this a WARNING() - it's an unsupported situation (the name must have been released other than via this function), but one that we do handle more or less gracefully. The test looks good.
(In reply to comment #2) > + if (!tp_dbus_daemon_release_name (self->priv->dbus, self->priv->bus_name, > + &error)) > + { > + ERROR ("Failed to release bus name (%s): %s", self->priv->bus_name, > + error->message); > > I'd make this a WARNING() - it's an unsupported situation (the name must have > been released other than via this function), but one that we do handle more or > less gracefully. done.
Marking this as a pseudo-duplicate, since it'll be merged when Bug #27872 is (and not before). *** This bug has been marked as a duplicate of bug 27872 ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.