summaryrefslogtreecommitdiff
path: root/main/bridge.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2015-03-26 22:19:21 +0000
committerCorey Farrell <git@cfware.com>2015-03-26 22:19:21 +0000
commit6adf26f14dbe2ed0addd5d07910c3b5546005987 (patch)
tree5f36ea9ec84c5a5180d4eaaae4a88eec95e37547 /main/bridge.c
parentd0df545a443cb00c75fdf1e61db909facd266aa9 (diff)
Replace most uses of ast_register_atexit with ast_register_cleanup.
Since 'core stop now' and 'core restart now' do not stop modules, it is unsafe for most of the core to run cleanups. Originally all cleanups used ast_register_atexit, and were only changed when it was shown to be unsafe. ast_register_atexit is now used only when absolutely required to prevent corruption and close child processes. Exceptions that need to use ast_register_atexit: * CDR: Flush records. * res_musiconhold: Kill external applications. * AstDB: Close the DB. * canary_exit: Kill canary process. ASTERISK-24142 #close Reported by: David Brillert ASTERISK-24683 #close Reported by: Peter Katzmann ASTERISK-24805 #close Reported by: Badalian Vyacheslav ASTERISK-24881 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4500/ Review: https://reviewboard.asterisk.org/r/4501/ ........ Merged revisions 433495 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/bridge.c')
-rw-r--r--main/bridge.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/main/bridge.c b/main/bridge.c
index 6737fa62f..9c1d044e6 100644
--- a/main/bridge.c
+++ b/main/bridge.c
@@ -5322,29 +5322,19 @@ static void bridge_prnt_obj(void *v_obj, void *where, ao2_prnt_fn *prnt)
/*!
* \internal
- * \brief Shutdown the bridging system. Stuff to always do.
- * \since 12.0.0
+ * \brief Shutdown the bridging system. Stuff to do on graceful shutdown.
+ * \since 13.3.0
*
* \return Nothing
*/
-static void bridge_shutdown(void)
+static void bridge_cleanup(void)
{
ast_manager_unregister("BridgeTechnologyList");
ast_manager_unregister("BridgeTechnologySuspend");
ast_manager_unregister("BridgeTechnologyUnsuspend");
ast_cli_unregister_multiple(bridge_cli, ARRAY_LEN(bridge_cli));
ao2_container_unregister("bridges");
-}
-/*!
- * \internal
- * \brief Shutdown the bridging system. More stuff to do on graceful shutdown.
- * \since 13.3.0
- *
- * \return Nothing
- */
-static void bridge_cleanup(void)
-{
ao2_cleanup(bridges);
bridges = NULL;
ao2_cleanup(bridge_manager);
@@ -5354,7 +5344,6 @@ static void bridge_cleanup(void)
int ast_bridging_init(void)
{
ast_register_cleanup(bridge_cleanup);
- ast_register_atexit(bridge_shutdown);
if (ast_stasis_bridging_init()) {
return -1;