[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [xml] xmlParserCtxt Leak?
- From: Andreas Stricker <andreas stricker fela ch>
- To: xml gnome org
- Subject: Re: [xml] xmlParserCtxt Leak?
- Date: Mon, 16 Jun 2008 09:21:26 +0200
Michael Tremel wrote:
> I've made the changes you've suggested,
> but the same results from Valgrind keep showing up. Even after adding
> xmlParserCleanup(), there are 10 allocs and 9 frees leaving 84 bytes
> "still reachable". I
>>> int main()
>>> {
>>> xmlParserCtxtPtr ctxt = xmlNewParserCtxt();
You should first initialize the library, using the LIBXML_TEST_VERSION
macro. Still don't forget to add xmlCleanupParser() at the very end:
#include <libxml/parser.h>
int main()
{
xmlParserCtxtPtr ctxt;
LIBXML_TEST_VERSION;
ctxt = xmlNewParserCtxt();
xmlInitParserCtxt(ctxt);
xmlFreeParserCtxt(ctxt);
xmlCleanupParser();
return 0;
}
I suggest you should look at the examples too:
http://www.xmlsoft.org/examples/index.html
Cheers, Andy
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]