[xml] Re: error output (again + elaborated)



Errors are still send to stderr, though :(

I found the reason: xmlInitParser sets xmlParserInitialized to 1 after it
has initialized the internal state of the parser.

However, xmlCleanupParser sets the variable back to 0, which means that
xmlParseDocument() and friends will call xmlInitParser() again (which sets
default error-handlers, outputting to stderr again).

Some background: I'm running libxml/libxslt in a threaded environment.
xmlInitParser() is run in a locked part of code because of non-reentrancy;
however, xmlCleanupParser() is called every time I finished handing one
document to avoid memory-leaks.

I'm not fully aware of the intricacies of xmlCleanupParser(), but could
anyone tell me if _not_ calling xmlCleanupParser() introduces leaks? If it
does, I might have a problem.

                                                                    robert



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