Commit 91eb560c authored by Rob Richards's avatar Rob Richards

__xmlGlobalInitMutexDestroy() will free global_init_lock on Win32. Patch

* globals.c threads.c include/libxml/threads.h: 
  __xmlGlobalInitMutexDestroy() will free global_init_lock on Win32.
  Patch from Marc-Antoine Ruel.

svn path=/trunk/; revision=3664
parent b9ba0fac
Fri Nov 16 11:55:36 CET 2007 Rob Richards <rrichards@ctindustries.net>
* globals.c threads.c include/libxml/threads.h:
__xmlGlobalInitMutexDestroy() will free global_init_lock on Win32.
Patch from Marc-Antoine Ruel.
Tue Nov 13 21:26:27 CET 2007 Rob Richards <rrichards@ctindustries.net>
* schematron.c: fix crash/leaks from xmlSchematronParse due to improper
......
......@@ -60,6 +60,7 @@ void xmlCleanupGlobals(void)
xmlFreeMutex(xmlThrDefMutex);
xmlThrDefMutex = NULL;
}
__xmlGlobalInitMutexDestroy();
}
/************************************************************************
......
......@@ -77,6 +77,7 @@ void __htmlParseContent(void *ctx);
*/
void __xmlGlobalInitMutexLock(void);
void __xmlGlobalInitMutexUnlock(void);
void __xmlGlobalInitMutexDestroy(void);
#ifdef IN_LIBXML
#ifdef __GNUC__
......
......@@ -451,6 +451,7 @@ __xmlGlobalInitMutexLock(void)
* section in the global_init_lock then discard the one
* allocated by this thread. */
if (global_init_lock != cs) {
DeleteCriticalSection(cs);
free(cs);
}
}
......@@ -500,6 +501,24 @@ __xmlGlobalInitMutexUnlock(void)
#endif
}
/**
* xmlGlobalInitMutexDestroy
*
* Makes sure that the global initialization mutex is destroyed before
* application termination.
*/
void __xmlGlobalInitMutexDestroy(void)
{
#if defined HAVE_WIN32_THREADS
if (global_init_lock != NULL)
{
DeleteCriticalSection(global_init_lock);
free(global_init_lock);
global_init_lock = NULL;
}
#endif
}
/************************************************************************
* *
* Per thread global state handling *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment