1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-27 04:55:04 +03:00

Call xmlCleanupParser on ELF destruction

Fixes #153.
This commit is contained in:
Samuel Thibault 2020-03-31 23:18:25 +02:00 committed by Nick Wellnhofer
parent e4fb368418
commit 9fa3200cb3
2 changed files with 20 additions and 1 deletions

View File

@ -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])

View File

@ -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 *