[Freeswitch-svn] [commit] r10006 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su

Freeswitch SVN mikej at freeswitch.org
Tue Oct 14 12:08:44 EDT 2008


Author: mikej
Date: Tue Oct 14 12:08:43 2008
New Revision: 10006

Modified:
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c

Log:
(SFSIP-88) handle leak on windows

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c	Tue Oct 14 12:08:43 2008
@@ -1019,8 +1019,15 @@
 
     home->suh_blocks = NULL;
 
-    if (home->suh_lock)
+    if (home->suh_lock) {
+#ifdef WIN32
+      UNLOCK(home); /* we must unlock here or windows leaks handles on the next call because the mutex is locked */
+#endif
+/* "In the LinuxThreads implementation, no resources are associated with mutex objects,
+   thus pthread_mutex_destroy actually does nothing except checking that the mutex is unlocked. "
+   In the Windows pthread implementation we must free the handles that are allocated */
       _su_home_destroy_mutexes(home->suh_lock);
+    }
   }
 
   home->suh_lock = NULL;



More information about the Freeswitch-svn mailing list