Re: [gtk-list] g_thread_init causes hangs



Hej Ola

> I tried to make a GTK program with pthreads and when trying
> to close the program by closing the window it hangs.
> I removed all thread code and it still hangs because
> of the g_thread_init call.
> See code below. Somehow the gtk_object_set_data_full() row
> is causing the problem, if I comment it the program works fine.

Ok, thanks for this detailed bug report. Its fixed in CVS:

Apply the following patch to your glib sources and recompile/reinstall them or
wait for the next release.
This should be save wrt the locked data, but please check: Owen or Tim.

--------------------------------------------------------------------
Index: gdataset.c
===================================================================
RCS file: /cvs/gnome/glib/gdataset.c,v
retrieving revision 1.13
diff -u -b -B -r1.13 gdataset.c
--- gdataset.c	1999/02/24 06:13:32	1.13
+++ gdataset.c	1999/10/15 11:54:59
@@ -110,7 +110,11 @@
       list = prev->next;
       
       if (prev->destroy_func)
+	{
+	  G_UNLOCK (g_dataset_global);
 	prev->destroy_func (prev->data);
+	  G_LOCK (g_dataset_global);
+	}
       
       if (g_data_cache_length < G_DATA_CACHE_MAX)
 	{
--------------------------------------------------------------------

(Förresten: Har det redan blivit allvarligt kallt där uppe? ;-)

Hej då,
Sebastian

-- 
Sebastian Wilhelmi                   |            här ovanför alla molnen
mailto:wilhelmi@ira.uka.de           |      är himmlen så förunerligt blå
http://goethe.ira.uka.de/~wilhelmi   |



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