[asterisk-commits] rizzo: trunk r48766 - /trunk/main/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Dec 21 12:36:43 MST 2006


Author: rizzo
Date: Thu Dec 21 13:36:42 2006
New Revision: 48766

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48766
Log:
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.


Modified:
    trunk/main/channel.c

Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=48766&r1=48765&r2=48766
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Thu Dec 21 13:36:42 2006
@@ -1572,7 +1572,8 @@
 	}
 	
 	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 */



More information about the asterisk-commits mailing list