mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 19:28:53 +00:00
Merge "Prevent unload of modules which implement an Optional API."
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -4714,6 +4714,10 @@ static int load_module(void)
|
||||
unload_module();
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
}
|
||||
|
||||
/* For Optional API. */
|
||||
ast_module_shutdown_ref(AST_MODULE_SELF);
|
||||
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
|
@@ -1446,6 +1446,9 @@ static int load_module(void)
|
||||
ast_http_uri_link(&websocketuri);
|
||||
websocket_add_protocol_internal("echo", websocket_echo_callback);
|
||||
|
||||
/* For Optional API. */
|
||||
ast_module_shutdown_ref(AST_MODULE_SELF);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -985,6 +985,9 @@ static int load_module(void)
|
||||
ast_manager_register_xml("PauseMonitor", EVENT_FLAG_CALL, pause_monitor_action);
|
||||
ast_manager_register_xml("UnpauseMonitor", EVENT_FLAG_CALL, unpause_monitor_action);
|
||||
|
||||
/* For Optional API. */
|
||||
ast_module_shutdown_ref(AST_MODULE_SELF);
|
||||
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
|
@@ -1472,6 +1472,10 @@ static int load_module(void)
|
||||
}
|
||||
ast_cli_register_multiple(cli_pktccops, sizeof(cli_pktccops) / sizeof(struct ast_cli_entry));
|
||||
restart_pktc_thread();
|
||||
|
||||
/* For Optional API. */
|
||||
ast_module_shutdown_ref(AST_MODULE_SELF);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -1405,6 +1405,10 @@ static int _unload_module(int fromload)
|
||||
}
|
||||
|
||||
smdi_loaded = 0;
|
||||
|
||||
/* For Optional API. */
|
||||
ast_module_shutdown_ref(AST_MODULE_SELF);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -353,6 +353,9 @@ static int load_module(void)
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
}
|
||||
|
||||
/* For Optional API. */
|
||||
ast_module_shutdown_ref(AST_MODULE_SELF);
|
||||
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user