[xml] xmlReadFile(...) crashing on 2nd time around




This is my code to read an XML file, which works fine the 1st time around,
but crashes the 2nd time around.  I must be not calling a required library
function to tidy up and would appreciate if someone could advise on what I
should do.

If I debug, the 1st time around xmlReadFile takes hardly any time, then the
2nd time around it doesn't return!  The destructor had been called after the
1st call.

In my class constructor:

        OpenSSL_add_all_algorithms(); 
        ERR_load_crypto_strings();

        m_pXmlDoc = xmlReadFile(m_szFilepath, NULL, XML_PARSE_DTDLOAD |
                                XML_PARSE_DTDATTR |
                                     XML_PARSE_NOENT |
                                XML_PARSE_HUGE);

In my class destructor:

             if (m_pXmlDoc)
        {
            xmlFreeDoc(m_pXmlDoc);
        }

        if (m_pXPathCtx)
        {
            xmlXPathFreeContext(m_pXPathCtx);
        }

        xmlCleanupParser();
-- 
View this message in context: 
http://old.nabble.com/xmlReadFile%28...%29-crashing-on-2nd-time-around-tp26731653p26731653.html
Sent from the Gnome - Lib - Xml - General mailing list archive at Nabble.com.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]