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

@@ -247,7 +247,6 @@ int daemon(int, int); /* defined in libresolv of all places */
#include "asterisk/stasis_endpoints.h"
#include "asterisk/stasis_system.h"
#include "asterisk/security_events.h"
#include "asterisk/optional_api.h"
#include "../defaults.h"
@@ -4169,10 +4168,6 @@ int main(int argc, char *argv[])
ast_el_read_history(filename);
}
#if defined(OPTIONAL_API)
ast_register_cleanup(optional_api_cleanup);
#endif
ast_json_init();
ast_ulaw_init();
ast_alaw_init();