summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-22 18:31:40 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-10-21 12:37:45 +0100
commit48e799e7184722047c4944ab16dc37751cc89227 (patch)
tree20a7d1d741d4ac20b5e558d611da916c86f2c3b0
parentce8f21c62064a3ccd3bfd2d01444e017312ab1d3 (diff)
downloaddbus-glib-48e799e7184722047c4944ab16dc37751cc89227.tar.gz
30574 test: use a private bus so we can free it more thoroughly
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41129 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--test/core/30574.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/core/30574.c b/test/core/30574.c
index 48ec7d7..7b75b3d 100644
--- a/test/core/30574.c
+++ b/test/core/30574.c
@@ -5,6 +5,7 @@
#include <dbus/dbus.h>
#include <glib.h>
#include <dbus/dbus-glib-lowlevel.h>
+#include "test/lib/util.h"
DBusConnection *bus;
GMainContext *main_context;
@@ -57,7 +58,7 @@ main(int argc, const char *argv[])
main_context = g_main_context_new ();
dbus_error_init (&error);
- bus = dbus_bus_get (DBUS_BUS_SESSION, &error);
+ bus = dbus_bus_get_private (DBUS_BUS_SESSION, &error);
if (!bus)
{
fprintf(stderr, "Couldn't connect to bus: %s\n", error.name);
@@ -97,5 +98,12 @@ main(int argc, const char *argv[])
dbus_message_unref (reply);
dbus_message_unref (message);
+ test_run_until_disconnected (dbus_connection_get_g_connection (bus),
+ NULL);
+ dbus_connection_unref (bus);
+
+ dbus_shutdown ();
+ g_main_context_unref (main_context);
+
return 0;
}