dect
/
asterisk
Archived
13
0
Fork 0

same as in other places, check that generator->release is not NULL

before calling it.
This allows generators to set it to NULL when they have nothing to
do there.

Later, the three copies of the code that releases a generator
should be moved to a function.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48766 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
rizzo 2006-12-21 19:36:42 +00:00
parent 6647f2a9a4
commit 90ea800e9b
1 changed files with 2 additions and 1 deletions

View File

@ -1572,7 +1572,8 @@ int ast_hangup(struct ast_channel *chan)
}
if (chan->generatordata) /* Clear any tone stuff remaining */
chan->generator->release(chan, chan->generatordata);
if (chan->generator && chan->generator->release)
chan->generator->release(chan, chan->generatordata);
chan->generatordata = NULL;
chan->generator = NULL;
if (chan->cdr) { /* End the CDR if it hasn't already */