From: Sebastian B. <sb...@us...> - 2013-12-24 09:28:03
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv617/gtk Modified Files: subthreads.c Log Message: Destroy the timeout source after running the loop. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- subthreads.c 24 Dec 2013 09:27:28 -0000 1.56 +++ subthreads.c 24 Dec 2013 09:28:01 -0000 1.57 @@ -457,6 +457,9 @@ { struct thread_wait_timer_entry_data data; struct thread_s *t; + GSource *s = NULL; + + SM_ENTER; memset(&data, 0, sizeof(data)); @@ -467,7 +470,7 @@ if (timer_callback) { - GSource *s = g_timeout_source_new(millis); + s = g_timeout_source_new(millis); g_source_set_callback(s, thread_wait_timer_entry, &data, NULL); g_source_attach(s, t->context); g_source_unref(s); @@ -475,6 +478,12 @@ g_main_loop_run(t->main_loop); + /* Destroy the timer if there was any */ + if (timer_callback && s) + g_source_destroy(s); + + SM_LEAVE; + return 0; } |