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: https://origsvn.digium.com/svn/asterisk/trunk@51801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2007-01-23 22:59:55 +00:00
parent ac884e0c3a
commit ee3ab150f6
9 changed files with 20 additions and 0 deletions

View File

@@ -580,6 +580,7 @@ static int alsa_hangup(struct ast_channel *c)
c->tech_pvt = NULL;
alsa.owner = NULL;
ast_verbose(" << Hangup on console >> \n");
ast_module_unref(ast_module_info->self);
if (hookstate) {
hookstate = 0;
if (!autoanswer) {
@@ -805,6 +806,7 @@ static struct ast_channel *alsa_new(struct chan_alsa_pvt *p, int state)
if (!ast_strlen_zero(language))
ast_string_field_set(tmp, language, language);
p->owner = tmp;
ast_module_ref(ast_module_info->self);
ast_jb_configure(tmp, &global_jbconf);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {