diff options
Diffstat (limited to 'dbus/dbus-connection.c')
-rw-r--r-- | dbus/dbus-connection.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index 7b13b249..1f427dd3 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -1678,21 +1678,26 @@ connection_forget_shared_unlocked (DBusConnection *connection) if (!connection->shareable) return; + _DBUS_LOCK (shared_connections); + if (connection->server_guid != NULL) { _dbus_verbose ("dropping connection to %s out of the shared table\n", connection->server_guid); - _DBUS_LOCK (shared_connections); - if (!_dbus_hash_table_remove_string (shared_connections, connection->server_guid)) _dbus_assert_not_reached ("connection was not in the shared table"); dbus_free (connection->server_guid); connection->server_guid = NULL; - _DBUS_UNLOCK (shared_connections); } + else + { + _dbus_list_remove (&shared_connections_no_guid, connection); + } + + _DBUS_UNLOCK (shared_connections); /* remove our reference held on all shareable connections */ _dbus_connection_unref_unlocked (connection); |