Re: [xml] [htmlParser] The right way to free a htmlParserCtxtPtr
- From: Daniel Veillard <veillard redhat com>
- To: Emmanuel Saracco <esaracco users labs libre-entreprise org>
- Cc: xml gnome org
- Subject: Re: [xml] [htmlParser] The right way to free a htmlParserCtxtPtr
- Date: Tue, 2 Nov 2004 03:52:26 -0500
On Tue, Nov 02, 2004 at 06:46:16AM +0100, Emmanuel Saracco wrote:
Hi,
I am wondering what is the most effective to free a htmlParserCtxtPtr.
For the moment I do the following:
-----
htmlParserCtxtPtr ctxt = NULL;
ctxt = htmlCreateMemoryParserCtxt (buffer, strlen (buffer));
htmlParseDocument (ctxt);
htmlFreeParserCtxt (ctxt);
-----
that's fine.
But browing the libxml2 source code I saw that there is a "htmlCtxtReset
()" that seems to really freeing all stuff (including "ctxt->myDoc").
Should I call this function just before calling "htmlFreeParserCtxt ()"?
This should be used only if you want to parse a collection of html
document with the same context, then the reset call should be used between
2 parses.
Daniel
--
Daniel Veillard | Red Hat Desktop team http://redhat.com/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]