diff options
author | Corey Farrell <git@cfware.com> | 2016-01-09 14:28:31 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2016-01-09 13:39:09 -0600 |
commit | dc2c000fd59a5c97d646a76d5f5dd7eaeb5a6a2a (patch) | |
tree | 406fe4aecd7d298f785851cfa647094c6272cbca /res/res_crypto.c | |
parent | e6f77da6642f399b0db8cb4a8faa42d37260cce6 (diff) |
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
Diffstat (limited to 'res/res_crypto.c')
-rw-r--r-- | res/res_crypto.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c index d8f328f08..e7cb72878 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 */ |