From: Travis Cross Date: Sat, 12 Apr 2014 06:31:31 +0000 (+0000) Subject: Avoid leaking memory on unload of mod_dptools X-Git-Tag: v1.5.12~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=237da22e22728a635c7b8cb32584fb808536d64e;p=thirdparty%2Ffreeswitch.git Avoid leaking memory on unload of mod_dptools Automated leak detectors find leaked memory on shutdown. Cleaning up after ourselves on shutdown eliminates noise from these reports. --- diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 5007689f86..6dbee87c95 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -5581,6 +5581,10 @@ SWITCH_STANDARD_API(page_api_function) SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dptools_shutdown) { switch_event_unbind_callback(pickup_pres_event_handler); + switch_mutex_destroy(globals.pickup_mutex); + switch_core_hash_destroy(&globals.pickup_hash); + switch_mutex_destroy(globals.mutex_mutex); + switch_core_hash_destroy(&globals.mutex_hash); return SWITCH_STATUS_SUCCESS; }