From: Andre Noll Date: Tue, 7 Oct 2014 19:50:25 +0000 (+0000) Subject: gui: Shutdown scheduler after schedule() returns. X-Git-Tag: v0.5.5~65 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=6ceaf430c5d331db83b591ae02d9eef5c87a31df;p=paraslash.git gui: Shutdown scheduler after schedule() returns. This makes sure all resources allocated by the scheduler are released. Since we exit anyway when schedule() returns, this is not a serious memory leak. The fix helps to identify real leaks though. --- diff --git a/gui.c b/gui.c index 370c731c..5d1a1b62 100644 --- a/gui.c +++ b/gui.c @@ -1408,6 +1408,7 @@ __noreturn static void print_help_and_die(void) static int setup_tasks_and_schedule(void) { + int ret; struct exec_task exec_task = {.task = NULL}; struct status_task status_task = {.fd = -1}; struct input_task input_task = {.task = NULL}; @@ -1451,7 +1452,9 @@ static int setup_tasks_and_schedule(void) .post_select = signal_post_select, .context = &signal_task, }, &sched); - return schedule(&sched); + ret = schedule(&sched); + sched_shutdown(&sched); + return ret; } /**