summaryrefslogtreecommitdiff
path: root/res/res_stasis_websocket.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-05-10 17:12:57 +0000
committerDavid M. Lee <dlee@digium.com>2013-05-10 17:12:57 +0000
commit4666079b05ea3b189e4fdccc665f7a61bf3e5535 (patch)
tree826e54b6a78671d7e911cbff4799b31b0aed9a30 /res/res_stasis_websocket.c
parentdb925c3f066fc73849af06bcfc966467af349891 (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 'res/res_stasis_websocket.c')
-rw-r--r--res/res_stasis_websocket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_stasis_websocket.c b/res/res_stasis_websocket.c
index 4cf5b9498..50fec0625 100644
--- a/res/res_stasis_websocket.c
+++ b/res/res_stasis_websocket.c
@@ -263,6 +263,7 @@ static int load_module(void)
{
int r = 0;
+ stasis_app_ref();
oom_json = ast_json_pack("{s: s}",
"error", "OutOfMemory");
if (!oom_json) {
@@ -277,6 +278,7 @@ static int unload_module(void)
{
int r = 0;
+ stasis_app_unref();
ast_json_unref(oom_json);
oom_json = NULL;
r |= ast_websocket_remove_protocol(ws_protocol, websocket_callback);