Update of /cvsroot/simplemail/simplemail/gtk
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31433/gtk
Modified Files:
subthreads.c
Log Message:
No longer uses the tad pointer after the function call.
The memory pointed by tad will be already trashed after the function decides that the
parent task shall continue.
Index: subthreads.c
===================================================================
RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- subthreads.c 24 Dec 2013 09:14:35 -0000 1.39
+++ subthreads.c 24 Dec 2013 09:15:06 -0000 1.40
@@ -181,19 +181,20 @@
static gpointer thread_add_entry(gpointer udata)
{
struct thread_add_data *tad = (struct thread_add_data*)udata;
+ struct thread_s *t = tad->thread;
/* TODO: Catch errors and inform parent task */
- tad->thread->context = g_main_context_new();
- tad->thread->main_loop = g_main_loop_new(tad->thread->context, FALSE);
+ t->context = g_main_context_new();
+ t->main_loop = g_main_loop_new(t->context, FALSE);
tad->entry(tad->eudata);
g_mutex_lock(thread_list_mutex);
- node_remove(&tad->thread->node);
+ node_remove(&t->node);
g_mutex_unlock(thread_list_mutex);
- g_main_loop_unref(tad->thread->main_loop);
- g_main_context_unref(tad->thread->context);
+ g_main_loop_unref(t->main_loop);
+ g_main_context_unref(t->context);
return NULL;
}
|