tests/closure: Use correct prototype for signal callback
authorColin Walters <walters@verbum.org>
Mon, 22 Jul 2013 11:51:00 +0000 (12:51 +0100)
committerColin Walters <walters@verbum.org>
Mon, 22 Jul 2013 13:34:24 +0000 (09:34 -0400)
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

gobject/tests/closure.c

index 8ecb058..5f1a22c 100644 (file)
@@ -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