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

windows: Use DllMain for cleanup

This commit is contained in:
Nick Wellnhofer 2024-07-16 00:13:49 +02:00
parent 5f3f66c683
commit a87944e970
2 changed files with 7 additions and 7 deletions

View File

@ -1007,6 +1007,13 @@ DllMain(ATTRIBUTE_UNUSED HINSTANCE hinstDLL, DWORD fdwReason,
}
#endif
break;
#ifndef LIBXML_THREAD_ALLOC_ENABLED
case DLL_PROCESS_DETACH:
if (xmlFree == free)
xmlCleanupParser();
break;
#endif
}
return TRUE;
}

View File

@ -385,13 +385,6 @@ static int onceControl = 0;
static void
xmlInitParserInternal(void) {
#if defined(_WIN32) && \
!defined(LIBXML_THREAD_ALLOC_ENABLED) && \
(!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
if (xmlFree == free)
atexit(xmlCleanupParser);
#endif
/*
* Note that the initialization code must not make memory allocations.
*/