diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-11-06 09:41:29 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-11-06 09:41:29 -0600 |
commit | 0eee42626a689c7425cd21b63144943e6ada033e (patch) | |
tree | d197cd6b4e7dd50f9081931e936a06dcc59c8443 /funcs | |
parent | 19c9200429f987e8bbbb644c1f233c61f27803d1 (diff) | |
parent | 73a5e9f0e9600bb656c31c9a091371b495b1fb03 (diff) |
Merge "Prevent unload of modules which implement an Optional API." into 13
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 f459e3576..0e260c9ca 100644 --- a/funcs/func_periodic_hook.c +++ b/funcs/func_periodic_hook.c @@ -490,6 +490,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_info->self); + } + return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS; } |