[asterisk-commits] russell: branch 1.2 r56406 - /branches/1.2/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Feb 23 13:17:57 MST 2007


Author: russell
Date: Fri Feb 23 14:17:56 2007
New Revision: 56406

URL: http://svn.digium.com/view/asterisk?view=rev&rev=56406
Log:
Don't destroy mutexes before unregistering all of the entry points from the core.
Also, fix a potential memory leak from not destroying the locks for all of the
possible call numbers (about 32k of them).

Modified:
    branches/1.2/channels/chan_iax2.c

Modified: branches/1.2/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_iax2.c?view=diff&rev=56406&r1=56405&r2=56406
==============================================================================
--- branches/1.2/channels/chan_iax2.c (original)
+++ branches/1.2/channels/chan_iax2.c Fri Feb 23 14:17:56 2007
@@ -9669,15 +9669,20 @@
 	delete_users();
 	iax_provision_unload();
 	sched_context_destroy(sched);
-	return 0;
-}
-
-int unload_module()
-{
+
 	ast_mutex_destroy(&iaxq.lock);
 	ast_mutex_destroy(&userl.lock);
 	ast_mutex_destroy(&peerl.lock);
 	ast_mutex_destroy(&waresl.lock);
+
+	for (x = 0; x < IAX_MAX_CALLS; x++)
+		ast_mutex_destroy(&iaxsl[x]);
+
+	return 0;
+}
+
+int unload_module()
+{
 	ast_custom_function_unregister(&iaxpeer_function);
 	return __unload_module();
 }



More information about the asterisk-commits mailing list