From: Andrey Volk Date: Tue, 10 Dec 2019 15:08:27 +0000 (+0400) Subject: [Core] Wait for all EVENT_DISPATCH_QUEUE_THREADS before killing the logging which... X-Git-Tag: v1.10.2^2~51^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F174%2Fhead;p=thirdparty%2Ffreeswitch.git [Core] Wait for all EVENT_DISPATCH_QUEUE_THREADS before killing the logging which leaks otherwise. --- diff --git a/src/switch_event.c b/src/switch_event.c index 6b1a3bfc42..b1e02e570a 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -571,9 +571,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping dispatch threads\n"); - for(x = 0; x < (uint32_t)DISPATCH_THREAD_COUNT; x++) { - switch_status_t st; - switch_thread_join(&st, EVENT_DISPATCH_QUEUE_THREADS[x]); + for(x = 0; x < (uint32_t)MAX_DISPATCH; x++) { + if (EVENT_DISPATCH_QUEUE_THREADS[x]) { + switch_status_t st; + switch_thread_join(&st, EVENT_DISPATCH_QUEUE_THREADS[x]); + } } }