[gtk+] Only check for finalization after a grace period



commit b980057764adc96797284cbd2ace80a00193f380
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu May 2 20:42:24 2013 -0400

    Only check for finalization after a grace period
    
    This makes the file chooser pass this test

 gtk/tests/objects-finalize.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/tests/objects-finalize.c b/gtk/tests/objects-finalize.c
index 0e5639c..d113eb3 100644
--- a/gtk/tests/objects-finalize.c
+++ b/gtk/tests/objects-finalize.c
@@ -26,11 +26,14 @@
 
 typedef GType (*GTypeGetFunc) (void);
 
+static gboolean finalized = FALSE;
+
 static gboolean
 main_loop_quit_cb (gpointer data)
 {
   gtk_main_quit ();
 
+  g_assert (finalized);
   return FALSE;
 }
 
@@ -48,7 +51,6 @@ test_finalize_object (gconstpointer data)
 {
   GType test_type = GPOINTER_TO_SIZE (data);
   GObject *object;
-  gboolean finalized = FALSE;
 
   object = g_object_new (test_type, NULL);
   g_assert (G_IS_OBJECT (object));
@@ -66,8 +68,6 @@ test_finalize_object (gconstpointer data)
   else
     g_object_unref (object);
 
-  g_assert (finalized);
-
   /* Even if the object did finalize, it may have left some dangerous stuff in the GMainContext */
   g_timeout_add (50, main_loop_quit_cb, NULL);
   gtk_main();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]