From 0da495081ac7eabc88632a6bf930eb4d19dc0b76 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 19:17:21 +0100 Subject: [PATCH] Fixed: Release libxml2 structures before exit --- code/nel/include/nel/misc/i_xml.h | 5 +++++ code/nel/src/misc/i_xml.cpp | 7 +++++-- code/ryzom/client/src/release.cpp | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/code/nel/include/nel/misc/i_xml.h b/code/nel/include/nel/misc/i_xml.h index b078eb7ee..50fdddd04 100644 --- a/code/nel/include/nel/misc/i_xml.h +++ b/code/nel/include/nel/misc/i_xml.h @@ -171,6 +171,11 @@ public: */ static bool getContentString (std::string &result, xmlNodePtr node); + /** + * Release meory used by libxml2, to only call before exit. + */ + static void releaseLibXml(); + private: /// From IStream diff --git a/code/nel/src/misc/i_xml.cpp b/code/nel/src/misc/i_xml.cpp index 3c8a3c6ba..719d5f359 100644 --- a/code/nel/src/misc/i_xml.cpp +++ b/code/nel/src/misc/i_xml.cpp @@ -103,13 +103,11 @@ void CIXml::release () // Free it xmlClearParserCtxt (_Parser); xmlFreeParserCtxt (_Parser); - // commented due to the bug #857 xmlCleanupParser (); _Parser = NULL; } // Not initialized - _Parser = NULL; _CurrentElement = NULL; _CurrentNode = NULL; _PushBegin = false; @@ -1143,6 +1141,11 @@ bool CIXml::getContentString (std::string &result, xmlNodePtr node) // *************************************************************************** +void CIXml::releaseLibXml() +{ + xmlCleanupParser(); +} + } // NLMISC #endif // NL_DONT_USE_EXTERNAL_CODE diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index 543230609..eafc8ae86 100644 --- a/code/ryzom/client/src/release.cpp +++ b/code/ryzom/client/src/release.cpp @@ -664,6 +664,7 @@ void release() NLGUI::CDBManager::release(); CWidgetManager::release(); CViewRenderer::release(); + CIXml::releaseLibXml(); #if FINAL_VERSION // openURL ("http://www.ryzomcore.org/exit/");