Fix graceful shutdown crash.
authorDavid M. Lee <dlee@digium.com>
Fri, 30 Aug 2013 20:58:59 +0000 (20:58 +0000)
committerDavid M. Lee <dlee@digium.com>
Fri, 30 Aug 2013 20:58:59 +0000 (20:58 +0000)
commit2d1d5a98d587f30311e254c7de623434dff07dd1
treecc4f15e91dc7ccd3df726f7f6af98355c76347a5
parentbe219c9ec9bcb1e54b8eed5ffaf7bced2f34abc4
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.
........

Merged revisions 398149 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/optional_api.h
main/asterisk.c
main/optional_api.c