From: Corey Farrell Date: Sat, 9 Jan 2016 19:28:31 +0000 (-0500) Subject: res_crypto: Perform cleanup at shutdown. X-Git-Tag: 11.22.0-rc1~41^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2fd720290450520c27f4a400c644894632784b3;p=thirdparty%2Fasterisk.git res_crypto: Perform cleanup at shutdown. This change causes res_crypto to unregister CLI at shutdown while still preventing the module from being unloaded. ASTERISK-25673 #close Change-Id: Ie5d57338dc2752abfc0dd05d0eec86413f2304fc --- diff --git a/res/res_crypto.c b/res/res_crypto.c index 2f0c67615d..71604aab62 100644 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -652,13 +652,17 @@ static int load_module(void) } else { crypto_load(-1, -1); } + + /* This prevents dlclose from ever running, but allows CLI cleanup at shutdown. */ + ast_module_shutdown_ref(ast_module_info->self); return AST_MODULE_LOAD_SUCCESS; } static int unload_module(void) { - /* Can't unload this once we're loaded */ - return -1; + ast_cli_unregister_multiple(cli_crypto, ARRAY_LEN(cli_crypto)); + + return 0; } /* needs usecount semantics defined */