aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-21 19:36:42 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-21 19:36:42 +0000
commit90ea800e9b095f3bd03c16373cd16a7a9a3c7bf9 (patch)
treef083356d9a002c4d60b3401e832274f12b72f63a
parent6647f2a9a43adcfb00fd643572432ad7e6b4200e (diff)
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
-rw-r--r--main/channel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 75db6d28f..3b06b266a 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -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 */