Commit 9fa3200c authored by Samuel Thibault's avatar Samuel Thibault Committed by Nick Wellnhofer
Browse files

Call xmlCleanupParser on ELF destruction

Fixes #153.
parent e4fb3684
......@@ -641,6 +641,16 @@ else
[Type cast for the send() function 2nd arg])
fi
dnl Checking whether __attribute__((destructor)) is accepted by the compiler
AC_MSG_CHECKING([whether __attribute__((destructor)) is accepted])
AC_TRY_COMPILE2([
void __attribute__((destructor))
f(void) {}], [], [
AC_MSG_RESULT(yes)
AC_DEFINE([ATTRIBUTE_DESTRUCTOR], [1],[Define if __attribute__((destructor)) is accepted])],[
AC_MSG_RESULT(no)])
dnl ***********************Checking for availability of IPv6*******************
AC_MSG_CHECKING([whether to enable IPv6])
......
......@@ -14599,7 +14599,7 @@ xmlInitParser(void) {
if (xmlParserInitialized != 0)
return;
#if defined(WIN32) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
#if defined(_WIN32) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
atexit(xmlCleanupParser);
#endif
......@@ -14681,6 +14681,15 @@ xmlCleanupParser(void) {
xmlParserInitialized = 0;
}
#if defined(ATTRIBUTE_DESTRUCTOR) && !defined(LIBXML_STATIC) && \
!defined(_WIN32)
static void
__attribute__((destructor))
xmlDestructor(void) {
xmlCleanupParser();
}
#endif
/************************************************************************
* *
* New set (2.6.0) of simpler and more flexible APIs *
......
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