From: Anthony Minessale Date: Tue, 8 Apr 2014 22:23:13 +0000 (+0500) Subject: clear event queue on shutdown X-Git-Tag: v1.5.12~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0449baca5935e8e05c4db205541719258e9f789e;p=thirdparty%2Ffreeswitch.git clear event queue on shutdown --- diff --git a/src/switch_scheduler.c b/src/switch_scheduler.c index a14c91e432..55875722bd 100644 --- a/src/switch_scheduler.c +++ b/src/switch_scheduler.c @@ -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;