Index: gobject/gtype.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/gtype.c,v
retrieving revision 1.78
diff -u -p -r1.78 gtype.c
--- gobject/gtype.c	1 Nov 2004 18:47:12 -0000	1.78
+++ gobject/gtype.c	10 Mar 2005 05:24:04 -0000
@@ -2373,7 +2373,9 @@ g_type_class_ref (GType type)
     {
       type_data_ref_Wm (node);
       G_WRITE_UNLOCK (&type_rw_lock);
-      
+     
+      while (node->data->class.init_state < INITIALIZED) ;
+
       return node->data->class.class;
     }
   
@@ -2461,6 +2463,8 @@ g_type_class_peek (GType type)
     class = NULL;
   G_READ_UNLOCK (&type_rw_lock);
   
+  while (class && class.init_state < INITIALIZED) ;
+
   return class;
 }
 
@@ -2480,6 +2484,8 @@ g_type_class_peek_static (GType type)
     class = NULL;
   G_READ_UNLOCK (&type_rw_lock);
   
+  while (class && class.init_state < INITIALIZED) ;
+
   return class;
 }
 
