[xml] Reusing a SAX push parser == sigsegv



Hi there,

I am writing my first application with libxml2.  I am parsing a stream,
then trying to recycle the parser for the next stream, using
xmlClearParserCtxt().  When I push the first chunk into the recycled
parser, my application dumps core in xmlParseTryOrFinish, because the RAW
macro derefs ctxt->input, which is 0x0.

Did I skip a step?  I would really like to be able to reuse the parser.
Otherwise, I will have to free it and reallocate a brand new one every
time a new document comes over my stream (frequently).

BTW, xmlClearParserCtxt is rather annoying in another sense, since it
allocs space for a new sax struct, and I have to memcpy my own sax
handlers back into the parser.  Also, xmlClearParserCtxt sets userData to
itself, which I also have to undo after it returns.

Regards,
Jeffrey Baker





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