Re: [xml] Memory not going away.. SOLUTION




Recall I had:

        xmlXPathInit();
        document_network = xmlParseFile(filename);
        ctxt = xmlXPathNewContext(document_network);

        xmlXPathFreeContext(ctxt);
        xmlFreeDoc(document_network);
        xmlCleanupParser();
        xmlMemoryDump();

The solution:

        xmlXPathInit();
        document_network = xmlParseFile(filename);
        ctxt = xmlXPathNewContext(document_network);

        xmlXPathFreeContext(ctxt);
        xmlCleanupParser();
        xmlFreeDoc(document_network);
        xmlMemoryDump();

Notice that I need to cleanup the parser prior to freeing the document.

David Bauer

Ph.D Candidate, Rensselaer Polytechnic Institute
Computer Science Department

Office: Amos Eaton 205
Phone : (518) 276 2657
URI   : http://www.cs.rpi.edu/~bauerd



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