aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-23 22:46:31 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-23 22:46:31 +0000
commitc7776916251e958e39a2fefd6a28a92fda4db23a (patch)
tree13789be06a91f943c067cfb42b6a1219d6328d6f /channels/chan_zap.c
parent2fca1655a1f427219d3a65e2c403a76bde344352 (diff)
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/branches/1.4@51788 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index bbec9c182..1420b6037 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -229,8 +229,6 @@ static int gendigittimeout = 8000;
/*! \brief How long to wait for an extra digit, if there is an ambiguous match */
static int matchdigittimeout = 3000;
-static int usecnt = 0;
-
/*! \brief Protect the interface list (of zt_pvt's) */
AST_MUTEX_DEFINE_STATIC(iflock);
@@ -2703,8 +2701,7 @@ static int zt_hangup(struct ast_channel *ast)
p->oprmode = 0;
ast->tech_pvt = NULL;
ast_mutex_unlock(&p->lock);
- ast_atomic_fetchadd_int(&usecnt, -1);
- ast_update_use_count();
+ ast_module_unref(ast_module_info->self);
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
@@ -5324,8 +5321,7 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
}
}
- ast_atomic_fetchadd_int(&usecnt, 1);
- ast_update_use_count();
+ ast_module_ref(ast_module_info->self);
return tmp;
}