From c3d3fe77815578949bd82e54ad6c2ce31bbd88e3 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 14 Aug 2022 01:37:45 +0400 Subject: Fix LibXML2 initalization/cleanup as requested by LibXML2 developers in github issue (fixes #1155330295) --- src/librcc.c | 4 +++- src/rccxml.c | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librcc.c b/src/librcc.c index 97725ec..41a49c8 100644 --- a/src/librcc.c +++ b/src/librcc.c @@ -138,7 +138,9 @@ void rccFree(void) { } rccEngineFree(); - rccXmlFree(); + // Clean-up might cause problems if LibXML2 is also used by an application outside of LibXML2... + // According to LibXML2 developers, usage of this function is not advised, cleanup only should be performed on application exit, and is done libxml2 automatically. + //rccXmlFree(); rccTranslateFree(); rccPluginFree(); diff --git a/src/rccxml.c b/src/rccxml.c index a864b36..82c3cd3 100644 --- a/src/rccxml.c +++ b/src/rccxml.c @@ -89,7 +89,6 @@ int rccXmlInit(int LoadConfiguration) { rcc_engine *engine; xmlInitParser(); - xmlInitCharEncodingHandlers(); xmlKeepBlanksDefault(0); if (LoadConfiguration) { @@ -243,7 +242,6 @@ void rccXmlFree() { xmlctx = NULL; } - xmlCleanupCharEncodingHandlers(); xmlCleanupParser(); } -- cgit v1.2.1