From: Colin Walters Date: Mon, 22 Jul 2013 11:51:00 +0000 (+0100) Subject: tests/closure: Use correct prototype for signal callback X-Git-Tag: 2.37.5~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00f5c63621d8a0e67562deaf529b6a9c9362e2d7;p=platform%2Fupstream%2Fglib.git tests/closure: Use correct prototype for signal callback This test worked when compiled without optimization, but fails with -O2. Presumably we just happened to find the GMainLoop off the stack somewhere. https://bugzilla.gnome.org/show_bug.cgi?id=704267 --- diff --git a/gobject/tests/closure.c b/gobject/tests/closure.c index 8ecb058..5f1a22c 100644 --- a/gobject/tests/closure.c +++ b/gobject/tests/closure.c @@ -169,6 +169,16 @@ send_usr1 (gpointer user_data) return FALSE; } +static gboolean +closure_quit_callback (gpointer user_data) +{ + GMainLoop *loop = user_data; + + g_main_loop_quit (loop); + + return TRUE; +} + static void test_closure_signal (void) { @@ -177,7 +187,7 @@ test_closure_signal (void) g_idle_add_full (G_PRIORITY_LOW, send_usr1, NULL, NULL); source = g_unix_signal_source_new (SIGUSR1); - test_source (source, G_CALLBACK (fd_quit_callback)); + test_source (source, G_CALLBACK (closure_quit_callback)); g_source_unref (source); } #endif