]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
clear event queue on shutdown
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 8 Apr 2014 22:23:13 +0000 (03:23 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 9 Apr 2014 18:26:46 +0000 (23:26 +0500)
src/switch_scheduler.c

index a14c91e43282ab2315864dd8de6dbc66953f4b50..55875722bd8de7d193abc4db8bfdfc8397b0d1e5 100644 (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;