From 0f82ff12ea10b914bebcaa0c93d1c09acd2fb039 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 9 Nov 2013 20:24:02 +0100 Subject: [PATCH] gdbus-proxy: Fix erroneous timeout during following tests Modified by Philip Withnall to amend a second instance in the same file. https://bugzilla.gnome.org/show_bug.cgi?id=711809 --- gio/tests/gdbus-proxy.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gio/tests/gdbus-proxy.c b/gio/tests/gdbus-proxy.c index 78a633b1a..8a2c324a2 100644 --- a/gio/tests/gdbus-proxy.c +++ b/gio/tests/gdbus-proxy.c @@ -835,6 +835,8 @@ fail_test (gpointer user_data) static void test_async (void) { + guint id; + g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, NULL, /* GDBusInterfaceInfo */ @@ -848,8 +850,10 @@ test_async (void) /* this is safe; testserver will exit once the bus goes away */ g_assert (g_spawn_command_line_async (g_test_get_filename (G_TEST_BUILT, "gdbus-testserver", NULL), NULL)); - g_timeout_add (10000, fail_test, NULL); + id = g_timeout_add (10000, fail_test, NULL); g_main_loop_run (loop); + + g_source_remove (id); } static void @@ -895,6 +899,7 @@ test_wellknown_noauto (void) { GError *error = NULL; GDBusProxy *proxy; + guint id; proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, @@ -904,9 +909,10 @@ test_wellknown_noauto (void) g_assert (proxy != NULL); g_dbus_proxy_call (proxy, "method", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, check_error, NULL); - g_timeout_add (10000, fail_test, NULL); + id = g_timeout_add (10000, fail_test, NULL); g_main_loop_run (loop); g_object_unref (proxy); + g_source_remove (id); } int