Fix shutdown crash caused by modules being left open.

It is only safe to run ast_register_cleanup callbacks when all modules
have been unloaded.  Previously these callbacks were run during graceful
shutdown, making it possible to crash during shutdown.

ASTERISK-26513 #close

Change-Id: Ibfa635bb688d1227ec54aa211d90d6bd45052e21
This commit is contained in:
Corey Farrell
2016-10-27 22:49:43 -04:00
parent e8a3af2629
commit f373de3020
4 changed files with 8 additions and 10 deletions

View File

@@ -16,6 +16,7 @@
#define _ASTERISK__PRIVATE_H
int load_modules(unsigned int); /*!< Provided by loader.c */
int modules_shutdown(void); /*!< Provided by loader.c */
int load_pbx(void); /*!< Provided by pbx.c */
int load_pbx_builtins(void); /*!< Provided by pbx_builtins.c */
int load_pbx_functions_cli(void); /*!< Provided by pbx_functions.c */

View File

@@ -228,13 +228,6 @@ int ast_loader_register(int (*updater)(void));
*/
int ast_loader_unregister(int (*updater)(void));
/*!
* \brief Run the unload() callback for all loaded modules
*
* This function should be called when Asterisk is shutting down gracefully.
*/
void ast_module_shutdown(void);
/*!
* \brief Match modules names for the Asterisk cli.
* \param line Unused by this function, but this should be the line we are