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.
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};
.post_select = signal_post_select,
.context = &signal_task,
}, &sched);
- return schedule(&sched);
+ ret = schedule(&sched);
+ sched_shutdown(&sched);
+ return ret;
}
/**