aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_oss.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-23 22:59:55 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-23 22:59:55 +0000
commit8cea0763f195bf88e3842ed09674b7d1a7f09c40 (patch)
treeb92765da4114be19e3a3b4dcbe2a54c1a4ad8084 /channels/chan_oss.c
parent15e3b6e0c04eaf9702935829af9dc2e7e8ec0707 (diff)
Merged revisions 51788 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r51788 | file | 2007-01-23 17:46:31 -0500 (Tue, 23 Jan 2007) | 2 lines Update channel drivers to use module referencing so that unloading them while in use will not result in crashes. (issue #8897 reported by junky) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@51801 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_oss.c')
-rw-r--r--channels/chan_oss.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index fb869cbf4..470c4aece 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -865,6 +865,7 @@ static int oss_hangup(struct ast_channel *c)
c->tech_pvt = NULL;
o->owner = NULL;
ast_verbose(" << Hangup on console >> \n");
+ ast_module_unref(ast_module_info->self);
if (o->hookstate) {
if (o->autoanswer || o->autohangup) {
/* Assume auto-hangup too */
@@ -1047,6 +1048,7 @@ static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx,
c->cid.cid_dnid = ast_strdup(ext);
o->owner = c;
+ ast_module_ref(ast_module_info->self);
ast_jb_configure(c, &global_jbconf);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(c)) {