aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-10-15 21:40:56 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-10-15 21:40:56 +0000
commit02eb80172aec45a868f23ad8497f9a3e9ca41045 (patch)
tree12b89e0120099cdf027686db19a43d8406c93e85 /res
parent849732b5b6efa05d7e49c261279ef939208ba41d (diff)
Ref/unref res_srtp when we create/destroy a session
This avoids unhappy crashing when we try to 'core stop gracefully' and res_srtp tries to unload before chan_sip does. Thanks, Russell! (closes issue #18085) Reported by: st git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@292016 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_srtp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_srtp.c b/res/res_srtp.c
index 76566d7de..808444ca0 100644
--- a/res/res_srtp.c
+++ b/res/res_srtp.c
@@ -382,6 +382,7 @@ static int ast_srtp_create(struct ast_srtp **srtp, struct ast_rtp_instance *rtp,
return -1;
}
+ ast_module_ref(ast_module_info->self);
temp->rtp = rtp;
*srtp = temp;
@@ -400,6 +401,7 @@ static void ast_srtp_destroy(struct ast_srtp *srtp)
ao2_t_ref(srtp->policies, -1, "Destroying container");
ast_free(srtp);
+ ast_module_unref(ast_module_info->self);
}
static int ast_srtp_add_stream(struct ast_srtp *srtp, struct ast_srtp_policy *policy)