diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-01-14 18:00:16 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-02-17 17:24:14 +0000 |
commit | 81425689773e6173f13ed3e3b2a252dd820a11f3 (patch) | |
tree | bad4c1f10ee7dadf88d14e57795a2b41bd5bcfca | |
parent | a4102ba51fc1c6b75099667d511a1acda988136c (diff) |
bus/test: assert that the client isn't listed, when appropriatewip-orphaned-test-stuff
If it was already in the list in these situations, it would be a
reference leak.
-rw-r--r-- | bus/test.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -133,6 +133,9 @@ bus_setup_debug_client (DBusConnection *connection) { dbus_bool_t retval; + /* it had better not be there already */ + _dbus_assert (_dbus_list_find_last (&clients, connection) == NULL); + if (!dbus_connection_add_filter (connection, client_disconnect_filter, NULL, NULL)) @@ -179,7 +182,9 @@ bus_setup_debug_client (DBusConnection *connection) dbus_connection_set_timeout_functions (connection, NULL, NULL, NULL, NULL, NULL); - _dbus_list_remove_last (&clients, connection); + /* we failed to add it (the last thing we do) or never tried, so it + * had better not be there */ + _dbus_assert (_dbus_list_find_last (&clients, connection) == NULL); if (clients == NULL) { |