From 9331ccf4a3eff9f18eb849b33948b7013cea8cf5 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 19 Nov 2012 16:12:32 +0000 Subject: [PATCH 3/3] test-profile: exit a bit more gracefully We close the connection to ourselves, resulting in libdbus shooting us in the head unless we ask it not to. Nice to see how thoroughly this code has been tested... For future reference, it can be tested like this: DBUS_TOP_BUILDDIR=$(pwd) ./test/core/run-test.sh profile (or substitute the real absolute top build directory, if out-of-tree). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40711 Signed-off-by: Simon McVittie --- test/core/test-profile.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/core/test-profile.c b/test/core/test-profile.c index ac8870d..cf20bb1 100644 --- a/test/core/test-profile.c +++ b/test/core/test-profile.c @@ -206,6 +206,8 @@ no_bus_thread_func (void *data) exit (1); } + dbus_connection_set_exit_on_disconnect (connection, FALSE); + context = g_main_context_new (); cd.iterations = 1; @@ -376,6 +378,8 @@ with_bus_thread_func (void *data) exit (1); } + dbus_connection_set_exit_on_disconnect (connection, FALSE); + if (!dbus_bus_register (connection, &error)) { g_printerr ("could not register with bus: %s\n", error.message); @@ -531,6 +535,8 @@ with_bus_init_server (ServerData *sd) connection = dbus_g_connection_get_connection (gconnection); + dbus_connection_set_exit_on_disconnect (connection, FALSE); + dbus_bus_request_name (connection, ECHO_SERVICE, 0, NULL); /* ignore errors because we suck */ -- 1.7.10.4