[xml] Relaxng memory discipline (Python bindings)



I'm trying to figure out the relaxng memory discipline under Python
bindings.

1. Whereas xmlNode uses manual free with xmlNode.freeNode(), the
relaxNgParserCtxt seems to rely on the garbage collector's __del__
callback. It seems like manual free is also possible using
relaxNgParserCtxt.relaxNGFreeParserCtxt. Is it fine to use this manual
free? Shouldn't relaxNGFreeParserCtxt set self._o to None to prevent
__del__ from calling xmlRelaxNGFreeParserCtxt twice?

2. Same issue for relaxNgSchema.

3. Same issue for relaxNgValidCtxt.

4. Is it ok to free the relaxNgParserCtxt before the relaxNgSchema
(and keep using the relaxNgSchema)?

5. Is it ok to free the relaxNgSchema before the relaxNgValidCtxt (and
keep using the relaxNgValidCtxt)?

6. How does libxml2.relaxNGCleanupTypes() fit in? Does this just clean
up some global state that is automatically created anytime you use one
of the relaxNg procedures?

Thank you!

-- 
Anthony Carrico



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