clear event queue on shutdown

This commit is contained in:
Anthony Minessale 2014-04-09 03:23:13 +05:00
parent 2d811e0ba0
commit 0449baca59
1 changed files with 6 additions and 0 deletions

View File

@ -194,6 +194,12 @@ static void *SWITCH_THREAD_FUNC switch_scheduler_task_thread(switch_thread_t *th
task_thread_loop(1);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Task thread ending\n");
while(switch_queue_trypop(globals.event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);
}
globals.task_thread_running = 0;
return NULL;