summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-11-06 09:41:29 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-11-06 09:41:29 -0600
commit0eee42626a689c7425cd21b63144943e6ada033e (patch)
treed197cd6b4e7dd50f9081931e936a06dcc59c8443 /res
parent19c9200429f987e8bbbb644c1f233c61f27803d1 (diff)
parent73a5e9f0e9600bb656c31c9a091371b495b1fb03 (diff)
Merge "Prevent unload of modules which implement an Optional API." into 13
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c4
-rw-r--r--res/res_http_websocket.c3
-rw-r--r--res/res_monitor.c3
-rw-r--r--res/res_pktccops.c4
-rw-r--r--res/res_smdi.c4
-rw-r--r--res/res_statsd.c3
6 files changed, 21 insertions, 0 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 3ea0cd329..4caa13bb1 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -4716,6 +4716,10 @@ static int load_module(void)
unload_module();
return AST_MODULE_LOAD_DECLINE;
}
+
+ /* For Optional API. */
+ ast_module_shutdown_ref(ast_module_info->self);
+
return AST_MODULE_LOAD_SUCCESS;
}
diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c
index f49a3573e..2baccc052 100644
--- a/res/res_http_websocket.c
+++ b/res/res_http_websocket.c
@@ -1439,6 +1439,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_info->self);
+
return 0;
}
diff --git a/res/res_monitor.c b/res/res_monitor.c
index c4ee674f9..b7ef2ea88 100644
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -987,6 +987,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_info->self);
+
return AST_MODULE_LOAD_SUCCESS;
}
diff --git a/res/res_pktccops.c b/res/res_pktccops.c
index 837e0f5e1..037e533d3 100644
--- a/res/res_pktccops.c
+++ b/res/res_pktccops.c
@@ -1474,6 +1474,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_info->self);
+
return 0;
}
diff --git a/res/res_smdi.c b/res/res_smdi.c
index 9a40227f2..7b4c42b17 100644
--- a/res/res_smdi.c
+++ b/res/res_smdi.c
@@ -1407,6 +1407,10 @@ static int _unload_module(int fromload)
}
smdi_loaded = 0;
+
+ /* For Optional API. */
+ ast_module_shutdown_ref(ast_module_info->self);
+
return 0;
}
diff --git a/res/res_statsd.c b/res/res_statsd.c
index eb0dc6702..b8e4d0475 100644
--- a/res/res_statsd.c
+++ b/res/res_statsd.c
@@ -355,6 +355,9 @@ static int load_module(void)
return AST_MODULE_LOAD_DECLINE;
}
+ /* For Optional API. */
+ ast_module_shutdown_ref(ast_module_info->self);
+
return AST_MODULE_LOAD_SUCCESS;
}