diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-23 20:17:56 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-23 20:17:56 +0000 |
commit | 196f6df7a4618323a26b2a228fc1be34b7379205 (patch) | |
tree | 85906014c0db3cd3e40b3dec51c8b8aee8a5241a /channels/chan_iax2.c | |
parent | 8283b7a0a47e38f2275b856891b47ca4f2099fc0 (diff) |
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).
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@56406 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index db1ee8e6a..1e23a726e 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -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(); } |