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

View File

@ -51,6 +51,8 @@ public:
bool ParseView(void); bool ParseView(void);
bool ParseGlobals(void); bool ParseGlobals(void);
void DeleteDocument(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) { bool cPluginSkinDesigner::Start(void) {
cXmlParser::InitLibXML();
bool trueColorAvailable = true; bool trueColorAvailable = true;
if (!cOsdProvider::SupportsTrueColor()) { if (!cOsdProvider::SupportsTrueColor()) {
esyslog("skindesigner: No TrueColor OSD found! Using default Skin LCARS!"); esyslog("skindesigner: No TrueColor OSD found! Using default Skin LCARS!");
@ -121,6 +122,7 @@ bool cPluginSkinDesigner::Start(void) {
void cPluginSkinDesigner::Stop(void) { void cPluginSkinDesigner::Stop(void) {
delete imgCache; delete imgCache;
delete fontManager; delete fontManager;
cXmlParser::CleanupLibXML();
} }
void cPluginSkinDesigner::Housekeeping(void) { void cPluginSkinDesigner::Housekeeping(void) {