[svn-commits] file: branch 1.6.2 r184678 - in /branches/1.6.2: ./ bridges/bridge_softmix.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Mar 27 10:58:14 CDT 2009


Author: file
Date: Fri Mar 27 10:58:11 2009
New Revision: 184678

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=184678
Log:
Merged revisions 184677 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r184677 | file | 2009-03-27 12:57:28 -0300 (Fri, 27 Mar 2009) | 7 lines
  
  Fix a potential timer leak in bridge_softmix.
  
  It is possible for a bridge to be created without actually being used.
  In that scenario a timing file descriptor would be opened and not
  closed. To fix this the timing file descriptor is now closed in the
  destroy callback, not the thread function.
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/bridges/bridge_softmix.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/bridges/bridge_softmix.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.2/bridges/bridge_softmix.c?view=diff&rev=184678&r1=184677&r2=184678
==============================================================================
--- branches/1.6.2/bridges/bridge_softmix.c (original)
+++ branches/1.6.2/bridges/bridge_softmix.c Fri Mar 27 10:58:11 2009
@@ -96,6 +96,16 @@
 	return 0;
 }
 
+/*! \brief Function called when a bridge is destroyed */
+static int softmix_bridge_destroy(struct ast_bridge *bridge)
+{
+	int timingfd = (unsigned long)bridge->bridge_pvt;
+
+	ast_timer_close(timingfd);
+
+	return 0;
+}
+
 /*! \brief Function called when a channel is joined into the bridge */
 static int softmix_bridge_join(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
 {
@@ -263,8 +273,6 @@
 		ao2_lock(bridge);
 	}
 
-	ast_timer_close(timingfd);
-
 	return 0;
 }
 
@@ -278,6 +286,7 @@
 	.formats = AST_FORMAT_SLINEAR,
 #endif
 	.create = softmix_bridge_create,
+	.destroy = softmix_bridge_destroy,
 	.join = softmix_bridge_join,
 	.leave = softmix_bridge_leave,
 	.write = softmix_bridge_write,




More information about the svn-commits mailing list