Move call to xmlCleanupParser 60/51860/6
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 16 Nov 2015 13:57:49 +0000 (14:57 +0100)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Tue, 24 Nov 2015 15:24:12 +0000 (07:24 -0800)
[Problem] xmlCleanupParser should be called only before program exit.
[Solution] Moved to global object constructor.

[Verification] Successfull compilation

Change-Id: Id2fedd8b99c9b598eaef14f7c12d37282e74814a

src/manager/initial-values/parser.cpp

index 535281a..6d6cd1e 100644 (file)
 namespace CKM {
 namespace XML {
 
+namespace {
+
+struct LibXmlCleanup {
+    ~LibXmlCleanup() { xmlCleanupParser(); }
+} cleanup;
+
+} // namespace anonymous
+
 Parser::Parser(const std::string &XML_filename)
     : m_errorCb(0)
 {
@@ -47,7 +55,6 @@ Parser::Parser(const std::string &XML_filename)
 }
 Parser::~Parser()
 {
-    xmlCleanupParser();
 }
 
 int Parser::Validate(const std::string &XSD_schema)