From db312316b85a25458166d40b7c483c0f0f509073 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 21 Sep 2012 15:37:03 +0100 Subject: [PATCH 03/21] mc-debug-server: don't self-terminate when disconnected from GDBus It appears something in MC now connects to D-Bus for a second time, using GDBus this time. We don't want to exit-on-disconnect for this one either, again so we free all memory before exiting. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 --- tests/twisted/mc-debug-server.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/twisted/mc-debug-server.c b/tests/twisted/mc-debug-server.c index f1cfa8f..03055e8 100644 --- a/tests/twisted/mc-debug-server.c +++ b/tests/twisted/mc-debug-server.c @@ -143,6 +143,7 @@ int main (int argc, char **argv) { GError *error = NULL; + GDBusConnection *gdbus = NULL; DBusConnection *connection = NULL; int ret = 1; GMainLoop *teardown_loop; @@ -165,6 +166,18 @@ main (int argc, char **argv) g_log_set_fatal_mask ("GLib-GObject", G_LOG_FATAL_MASK | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); + gdbus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + + if (gdbus == NULL) + { + g_warning ("%s", error->message); + g_error_free (error); + error = NULL; + goto out; + } + + g_dbus_connection_set_exit_on_close (gdbus, FALSE); + bus_daemon = tp_dbus_daemon_dup (&error); if (bus_daemon == NULL) @@ -236,6 +249,7 @@ out: dbus_connection_flush (connection); } + tp_clear_object (&gdbus); tp_clear_object (&bus_daemon); dbus_shutdown (); -- 1.7.10.4