From d68f8012b2d8b9b86b47ed1f091f29d70016cf73 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 22 Jun 2010 15:31:55 -0400 Subject: [PATCH] gio/tests/testapps: Fix source refcounting Either child_watch_source or timeout_source will already have been destroyed after we finish the loop, and it's not safe to call g_source_destroy() on it a second time unless we're still holding a ref on it. --- gio/tests/testapps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gio/tests/testapps.c b/gio/tests/testapps.c index 854d7fa7e..1def17058 100644 --- a/gio/tests/testapps.c +++ b/gio/tests/testapps.c @@ -142,17 +142,17 @@ await_child_termination_run (AwaitChildTerminationData *data) child_watch_source = g_child_watch_source_new (data->pid); g_source_set_callback (child_watch_source, (GSourceFunc) on_child_termination_exited, data, NULL); g_source_attach (child_watch_source, data->context); - g_source_unref (child_watch_source); timeout_source = g_timeout_source_new_seconds (5); g_source_set_callback (timeout_source, on_child_termination_timeout, data, NULL); g_source_attach (timeout_source, data->context); - g_source_unref (timeout_source); g_main_loop_run (data->loop); g_source_destroy (child_watch_source); + g_source_unref (child_watch_source); g_source_destroy (timeout_source); + g_source_unref (timeout_source); g_main_loop_unref (data->loop);