diff options
author | Joshua Colp <jcolp@digium.com> | 2017-11-06 10:11:51 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-11-06 10:11:51 -0600 |
commit | 68b6ebd83614a5cfacc43191f785a82a4239a9e6 (patch) | |
tree | 46f822ceda11aa9931cc5172e911faa72e1c3141 /funcs | |
parent | ac7ec5026c11ca598d6de1ce5ce004c3ffe1c96c (diff) | |
parent | 79f111e1f317fffd3222b70c31a0fac65c40234e (diff) |
Merge "Prevent unload of modules which implement an Optional API."
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_periodic_hook.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/funcs/func_periodic_hook.c b/funcs/func_periodic_hook.c index f8e79b326..0ab3d6b8b 100644 --- a/funcs/func_periodic_hook.c +++ b/funcs/func_periodic_hook.c @@ -488,6 +488,11 @@ static int load_module(void) res = ast_custom_function_register_escalating(&hook_function, AST_CFE_BOTH); + if (!res) { + /* For Optional API. */ + ast_module_shutdown_ref(AST_MODULE_SELF); + } + return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS; } |