mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-17 18:19:45 +00:00
Prevent unload of modules which implement an Optional API.
Once an Optional API module is loaded it should stay loaded. Unloading an optional API module runs the risk of a crash if something else is using it. This patch causes all optional API providers to tell the module loader not to unload except at shutdown. ASTERISK-27389 Change-Id: Ia07786fe655681aec49cc8d3d96e06483b11f5e6
This commit is contained in:
@@ -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