summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorEduardo Lima (Etrunko) <eduardo.lima@intel.com>2013-07-23 10:43:36 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2013-07-23 10:43:36 +0900
commit77189092184d00f4ae1838e422026da0d0d96ae2 (patch)
tree228513c1fadf09cdab3c74670fab30f9c4a8200a /bus
parentee6b756b9b89af0343ebcb5f60d6f49ac1813f94 (diff)
Remove reference to primary owner on ReleaseName
BUG=http://code.google.com/p/ibus/issues/detail?id=1636 TEST=src/tests/ibus-bus.c Review URL: https://codereview.appspot.com/11004043 Patch from Eduardo Lima (Etrunko) <eduardo.lima@intel.com>.
Diffstat (limited to 'bus')
-rw-r--r--bus/dbusimpl.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c
index ad69c8ed..688502f1 100644
--- a/bus/dbusimpl.c
+++ b/bus/dbusimpl.c
@@ -1093,6 +1093,7 @@ bus_dbus_impl_release_name (BusDBusImpl *dbus,
GDBusMethodInvocation *invocation)
{
const gchar *name= NULL;
+ BusNameService *service;
g_variant_get (parameters, "(&s)", &name);
if (name == NULL ||
@@ -1113,11 +1114,25 @@ bus_dbus_impl_release_name (BusDBusImpl *dbus,
}
guint retval;
- if (g_hash_table_lookup (dbus->names, name) == NULL) {
+ service = g_hash_table_lookup (dbus->names, name);
+ if (service == NULL) {
retval = 2; /* DBUS_RELEASE_NAME_REPLY_NON_EXISTENT */
}
else {
+ /* "ReleaseName" method removes the name in connection->names
+ * and the connection owner.
+ * bus_dbus_impl_connection_destroy_cb() removes all
+ * connection->names and the connection owners.
+ * See also comments in bus_dbus_impl_connection_destroy_cb().
+ */
if (bus_connection_remove_name (connection, name)) {
+ BusConnectionOwner *owner =
+ bus_name_service_find_owner (service, connection);
+ bus_name_service_remove_owner (service, owner, dbus);
+ if (service->owners == NULL) {
+ g_hash_table_remove (dbus->names, service->name);
+ }
+ bus_connection_owner_free (owner);
retval = 1; /* DBUS_RELEASE_NAME_REPLY_RELEASED */
}
else {