From a2e6c6277f31dcc9464070e0021a40598a7e9979 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Thu, 21 Dec 2006 19:36:42 +0000 Subject: [PATCH] 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: https://origsvn.digium.com/svn/asterisk/trunk@48766 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/channel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/channel.c b/main/channel.c index 75db6d28f3..3b06b266ad 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 */