Init/Cleanup libxml only once at VDR start/end. Copied from xmltv2vdr plugin.

This commit is contained in:
Manuel Reimer 2014-11-12 16:58:01 +01:00
parent 234c855990
commit d7aa09fec3
3 changed files with 13 additions and 3 deletions

View File

@ -12,7 +12,6 @@ cXmlParser::cXmlParser(void) {
root = NULL;
ctxt = NULL;
xmlInitParser();
initGenericErrorDefaultFunc(NULL);
xmlSetStructuredErrorFunc(NULL, SkinDesignerXMLErrorHandler);
ctxt = xmlNewParserCtxt();
@ -21,7 +20,6 @@ cXmlParser::cXmlParser(void) {
cXmlParser::~cXmlParser() {
DeleteDocument();
xmlFreeParserCtxt(ctxt);
xmlCleanupParser();
}
/*********************************************************************
@ -737,3 +735,11 @@ bool cXmlParser::DebugViewElement(xmlNodePtr node) {
}
return false;
}
void cXmlParser::InitLibXML() {
xmlInitParser();
}
void cXmlParser::CleanupLibXML() {
xmlCleanupParser();
}

View File

@ -51,6 +51,8 @@ public:
bool ParseView(void);
bool ParseGlobals(void);
void DeleteDocument(void);
static void InitLibXML();
static void CleanupLibXML();
};
#endif //__XMLPARSER_H
#endif //__XMLPARSER_H

View File

@ -95,6 +95,7 @@ bool cPluginSkinDesigner::Initialize(void) {
}
bool cPluginSkinDesigner::Start(void) {
cXmlParser::InitLibXML();
bool trueColorAvailable = true;
if (!cOsdProvider::SupportsTrueColor()) {
esyslog("skindesigner: No TrueColor OSD found! Using default Skin LCARS!");
@ -121,6 +122,7 @@ bool cPluginSkinDesigner::Start(void) {
void cPluginSkinDesigner::Stop(void) {
delete imgCache;
delete fontManager;
cXmlParser::CleanupLibXML();
}
void cPluginSkinDesigner::Housekeeping(void) {