Ralf Junker <ralfjunker@gmx.de> pointed out a ouple of leaks in the
Windows locale support:
* libxslt/xslt.c: add cleanup code for the mutex in xsltUninit()
* libxslt/xsltlocale.c libxslt/xsltlocale.h: add a new cleanup function
xsltFreeLocales
* libxslt/extensions.c: add a call to xsltFreeLocales in xsltCleanupGlobals
xmlFreeMutex(xsltExtMutex);
xsltExtMutex = NULL;
+ xsltFreeLocales();
xsltUninit();
}
*/
void
xsltUninit (void) {
+#ifdef XSLT_LOCALE_WINAPI
+ xmlFreeRMutex(xsltLocaleMutex);
+ xsltLocaleMutex = NULL;
+#endif
initialized = 0;
}
#endif
/**
+ * xsltFreeLocales:
+ *
+ * Cleanup function for the locale support on shutdown
+ */
+void
+xsltFreeLocales(void) {
+#ifdef XSLT_LOCALE_WINAPI
+ xmlRMutexLock(xsltLocaleMutex);
+ xmlFree(xsltLocaleList);
+ xsltLocaleList = NULL;
+ xmlRMutexUnlock(xsltLocaleMutex);
+#endif
+}
+
+/**
* xsltNewLocale:
* @languageTag: RFC 3066 language tag
*
void xsltFreeLocale(xsltLocale locale);
xsltLocaleChar *xsltStrxfrm(xsltLocale locale, const xmlChar *string);
int xsltLocaleStrcmp(xsltLocale locale, const xsltLocaleChar *str1, const xsltLocaleChar *str2);
+void xsltFreeLocales(void);
#endif /* __XML_XSLTLOCALE_H__ */