diff options
author | David M. Lee <dlee@digium.com> | 2013-05-10 17:12:57 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-05-10 17:12:57 +0000 |
commit | 4666079b05ea3b189e4fdccc665f7a61bf3e5535 (patch) | |
tree | 826e54b6a78671d7e911cbff4799b31b0aed9a30 /apps/app_stasis.c | |
parent | db925c3f066fc73849af06bcfc966467af349891 (diff) |
Address unload order issues for res_stasis* modules
I've noticed when doing a graceful shutdown that the res_stasis_http.so
module gets unloaded before the modules that use it, which causes some
asserts during their unload.
While r386928 was a quick hack to get it to not assert and die, this
patch increases the use counts on res_stasis.so and res_stasis_http.so
properly. It's a bigger change than I expected, hence the review instead
of just committing it.
Review: https://reviewboard.asterisk.org/r/2489/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_stasis.c')
-rw-r--r-- | apps/app_stasis.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/app_stasis.c b/apps/app_stasis.c index aa255ba3d..866e03387 100644 --- a/apps/app_stasis.c +++ b/apps/app_stasis.c @@ -93,6 +93,7 @@ static int load_module(void) { int r = 0; + stasis_app_ref(); r |= ast_register_application_xml(stasis, app_exec); return r; } @@ -100,12 +101,15 @@ static int load_module(void) static int unload_module(void) { int r = 0; - r |= ast_unregister_application(stasis); + stasis_app_unref(); return r; } -AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, - "Stasis dialplan application", - .load = load_module, - .unload = unload_module); +AST_MODULE_INFO(ASTERISK_GPL_KEY, + AST_MODFLAG_DEFAULT, + "Stasis dialplan application", + .load = load_module, + .unload = unload_module, + .nonoptreq = "res_stasis", + ); |