summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-11-19 16:12:32 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-12-04 17:42:38 +0000
commita90fe0f1d742579b6bcc07980551969c556c184b (patch)
treef8159e669962764d8f0f3f50dd7585ef2963d55b
parentfac9b965fb65352641521d380b1428702015012b (diff)
downloaddbus-glib-a90fe0f1d742579b6bcc07980551969c556c184b.tar.gz
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 <simon.mcvittie@collabora.co.uk> Reviewed-by: Dan Williams <dcbw@redhat.com>
-rw-r--r--test/core/test-profile.c6
1 files changed, 6 insertions, 0 deletions
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 */