[asterisk-commits] russell: trunk r75806 - /trunk/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 18 17:52:55 CDT 2007


Author: russell
Date: Wed Jul 18 17:52:54 2007
New Revision: 75806

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75806
Log:
I thought I noticed a memory leak earlier when I saw that the contents of this
list were not destroyed when the module is unloaded.  However, after reading
the code related to the use of this list a lot today, I realized that it isn't
necessary.  So, I have added a comment to explain why it isn't necessary.

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=75806&r1=75805&r2=75806
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Wed Jul 18 17:52:54 2007
@@ -646,6 +646,13 @@
 	int frames_received;
 };
 
+/*!
+ * \brief a list of frames that may need to be retransmitted
+ *
+ * \note The contents of this list do not need to be explicitly destroyed
+ * on module unload.  This is because all active calls are destroyed, and
+ * all frames in this queue will get destroyed as a part of that process.
+ */
 static AST_LIST_HEAD_STATIC(frame_queue, iax_frame);
 
 static AST_LIST_HEAD_STATIC(users, iax2_user);
@@ -10807,9 +10814,10 @@
 	
 	ast_netsock_release(netsock);
 	ast_netsock_release(outsock);
-	for (x=0;x<IAX_MAX_CALLS;x++)
+	for (x = 0; x < IAX_MAX_CALLS; x++) {
 		if (iaxs[x])
 			iax2_destroy(x);
+	}
 	ast_manager_unregister( "IAXpeers" );
 	ast_manager_unregister( "IAXnetstats" );
 	ast_unregister_application(papp);




More information about the asterisk-commits mailing list