[asterisk-commits] rmudgett: branch group/bridge_construction r385035 - /team/group/bridge_const...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 8 15:32:39 CDT 2013


Author: rmudgett
Date: Mon Apr  8 15:32:35 2013
New Revision: 385035

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385035
Log:
Move bridge_channel wr_queue flushing to the destructor.

Modified:
    team/group/bridge_construction/main/bridging.c

Modified: team/group/bridge_construction/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/group/bridge_construction/main/bridging.c?view=diff&rev=385035&r1=385034&r2=385035
==============================================================================
--- team/group/bridge_construction/main/bridging.c (original)
+++ team/group/bridge_construction/main/bridging.c Mon Apr  8 15:32:35 2013
@@ -2159,8 +2159,6 @@
 /*! \brief Join a channel to a bridge and handle anything the bridge may want us to do */
 static void bridge_channel_join(struct ast_bridge_channel *bridge_channel)
 {
-	struct ast_frame *fr;
-
 	ast_format_copy(&bridge_channel->read_format, ast_channel_readformat(bridge_channel->chan));
 	ast_format_copy(&bridge_channel->write_format, ast_channel_writeformat(bridge_channel->chan));
 
@@ -2215,13 +2213,6 @@
 
 	ast_bridge_unlock(bridge_channel->bridge);
 
-	/* Flush any unhandled wr_queue frames. */
-	ast_bridge_channel_lock(bridge_channel);
-	while ((fr = AST_LIST_REMOVE_HEAD(&bridge_channel->wr_queue, frame_list))) {
-		ast_frfree(fr);
-	}
-	ast_bridge_channel_unlock(bridge_channel);
-
 	/* Indicate a source change since this channel is leaving the bridge system. */
 	ast_indicate(bridge_channel->chan, AST_CONTROL_SRCCHANGE);
 
@@ -2308,6 +2299,7 @@
 static void bridge_channel_destroy(void *obj)
 {
 	struct ast_bridge_channel *bridge_channel = obj;
+	struct ast_frame *fr;
 
 	ast_bridge_channel_clear_roles(bridge_channel);
 
@@ -2319,7 +2311,13 @@
 		ao2_ref(bridge_channel->bridge, -1);
 		bridge_channel->bridge = NULL;
 	}
+
+	/* Flush any unhandled wr_queue frames. */
+	while ((fr = AST_LIST_REMOVE_HEAD(&bridge_channel->wr_queue, frame_list))) {
+		ast_frfree(fr);
+	}
 	pipe_close(bridge_channel->alert_pipe);
+
 	ast_cond_destroy(&bridge_channel->cond);
 }
 




More information about the asterisk-commits mailing list