]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't destroy mutexes before unregistering all of the entry points from the core.
authorRussell Bryant <russell@russellbryant.com>
Fri, 23 Feb 2007 20:17:56 +0000 (20:17 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 23 Feb 2007 20:17:56 +0000 (20:17 +0000)
Also, fix a potential memory leak from not destroying the locks for all of the
possible call numbers (about 32k of them).

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@56406 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index db1ee8e6acc37083657413301e4324f367f6d8cb..1e23a726ec8864b8c4df86b03c688554d89ce7c5 100644 (file)
@@ -9669,15 +9669,20 @@ static int __unload_module(void)
        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();
 }