Re: Introduction of the TnyLockable



Philip Van Hoof wrote:
> Issuing signals will always have to be done after you g_idle out of the
> function. Well it doesn't have to be done that way, but then will your
> signal handler run in the thread (and then you would need the gdk
> locking, which is probably not what you want).
> 
> That's because the function is always launched in a thread.

I've been reviewing the code and I think there is a bug, IMO
g_thread_join and g_main_loop_unref are called in a wrong order because
we should wait first for the thread to finish (it will call
g_main_loop_quit) and after that unref it. (See the attached patch in
order to better understand what I'm talking about)

Br
Index: libtinymail-camel/tny-session-camel.c
===================================================================
--- libtinymail-camel/tny-session-camel.c	(revision 1445)
+++ libtinymail-camel/tny-session-camel.c	(working copy)
@@ -306,10 +306,10 @@
 		g_main_loop_run (results.loop);
 		tny_lockable_lock (priv->ui_lock);
 
+		g_thread_join (thread);
+
 		g_main_loop_unref (results.loop);
 
-		g_thread_join (thread);
-
 		retval = results.data;
 		cancel = results.cancel;
 


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