Fix graceful shutdown crash.

The cleanup code for optional_api needs to happen after all of the optional
API users and providers have unused/unprovided. Unfortunately, regsitering the
atexit() handler at the beginning of main() isn't soon enough, since module
destructors run after that.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@398149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
David M. Lee
2013-08-30 20:58:07 +00:00
parent ddf1f5bbe0
commit 7e84877b2c
3 changed files with 6 additions and 27 deletions

View File

@@ -176,14 +176,6 @@ void ast_optional_api_use(const char *symname, ast_optional_fn *optional_ref,
void ast_optional_api_unuse(const char *symname, ast_optional_fn *optional_ref,
const char *module);
/*!
* \brief Call at exit to clean up optional_api internals.
*
* Since the optional_api code might run before main() starts, it can't safely
* register its own cleanup handlers. That has to be done within main().
*/
void optional_api_cleanup(void);
#define AST_OPTIONAL_API_NAME(name) __##name
#if defined(AST_API_MODULE)