diff options
author | Corey Farrell <git@cfware.com> | 2017-11-01 20:46:11 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-11-01 20:46:11 -0400 |
commit | 79f111e1f317fffd3222b70c31a0fac65c40234e (patch) | |
tree | aa1f51880780200956e46e1be7757be30a423963 /res/res_pktccops.c | |
parent | 64f1294ef2c799cda27ee83258fc5567a274bb34 (diff) |
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
Diffstat (limited to 'res/res_pktccops.c')
-rw-r--r-- | res/res_pktccops.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_pktccops.c b/res/res_pktccops.c index 4f6944875..e8d266cda 100644 --- a/res/res_pktccops.c +++ b/res/res_pktccops.c @@ -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; } |