Heads-Up: Beware of xmlCleanupParser() when your package links against libxml2

Michael Cronenworth mike at cchtml.com
Wed Jan 13 21:57:46 UTC 2010


Daniel Veillard wrote:
> The problem is that you can perfectly have application not relying on
> libxml2 outside of their own code use libxml2 at different phases,
> for example when parsing input, and when generating result, not using
> the library in the meantime and calling xmlCleanupParser() twice (or
> more) in a perfectly legal way.
>

Can the function call be renamed?

xmlCleanupLibrary() ?

This might lower the chance of it being implemented multiple times.

Heck, allocate 1 bit-field for a check on the function call to determine 
if it has already been run or not...


More information about the devel mailing list