summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2008-05-30 20:25:36 -0400
committerColin Walters <walters@verbum.org>2008-05-30 20:25:36 -0400
commit0e2a099b55a50b9b5a0f948e134b5a88e2924262 (patch)
tree6394550e4478877f735d59016f1d950475962779 /dbus
parentfd32a72b2f3855ef551d0063ea1e6bea4554be08 (diff)
Bug 15571: Clean up GUID-less connections correctly (Scott James Remnant)
* dbus/dbus-connection.c (connection_forget_shared_unlocked): Remove shared connections which lack a GUID from the list that caches those, otherwise references to them will remain after they have been freed. * test/name-test/test-privserver-client.c: Update test to try GUID-less connections too.
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-connection.c11
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);