From: Christophe de V. <cde...@al...> - 2003-04-23 23:15:13
|
Le Mercredi 23 Avril 2003 19:03, Christophe de VIENNE a =E9crit : > In fact the good solution is probably to use xmlSAXUserParseFile and > xmlSAXUserParseMemory to create the contexts, and not > xmlCreateMemoryParserCtxt and xmlCreateFileParserCtxt which are to be used > only for DOM. It seems I've spoken a bit fast sorry ;-) We can't do that. The functions I= =20 spoke about don't return a context. So we have to make sure either the sax handler can be freed by libxml, eith= er=20 handle it ourselves. The proposed solution was not handling the same problem happening with=20 xmlCreatePushParserCtxt, that we use for parse_chunk and parse_stream, whic= h=20 makes a copy of the sax handle we give to it, and this copy is never=20 released. So I removed the reset of sax handler in release_underlying. In parse, I ju= st=20 save the defaut sax parser and restore after parsing, as it is done in=20 xmlCreateMemoryParserCtxt for example. I think this correct the problem(s). Cheers, Christophe |