diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2004-07-02 13:53:31 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2004-07-02 13:53:31 +0000 |
commit | a3a4c25d47e8fd9a817ad25c74c53e13a570cf36 (patch) | |
tree | 45529edf5ae00acd68bfa57187a26680b56d102c /python | |
parent | 916d36f00a254b8c2d8578bed3644aae7e7e77f2 (diff) | |
download | libxslt-a3a4c25d47e8fd9a817ad25c74c53e13a570cf36.tar.gz libxslt-a3a4c25d47e8fd9a817ad25c74c53e13a570cf36.tar.bz2 libxslt-a3a4c25d47e8fd9a817ad25c74c53e13a570cf36.zip |
convenience change try to avoid calling libxml2 cleanup function directly
* configure.in: convenience change
* python/libxsl.py python/libxslt-python-api.xml python/libxslt.c:
try to avoid calling libxml2 cleanup function directly but go
though the python wrapper of libxml2 for memory debug accounting.
Daniel
Diffstat (limited to 'python')
-rw-r--r-- | python/libxsl.py | 5 | ||||
-rw-r--r-- | python/libxslt-python-api.xml | 4 | ||||
-rw-r--r-- | python/libxslt.c | 5 | ||||
-rw-r--r-- | python/libxsltclass.txt | 2 |
4 files changed, 10 insertions, 6 deletions
diff --git a/python/libxsl.py b/python/libxsl.py index aa0ba430..404b1dc3 100644 --- a/python/libxsl.py +++ b/python/libxsl.py @@ -84,6 +84,11 @@ class extensionModule: """Callback function when a transformation using it finishes""" pass +def cleanup(): + """Cleanup all libxslt and libxml2 memory allocated""" + libxsltmod.xsltPythonCleanup() + libxml2.cleanupParser() + # # Everything below this point is automatically generated # diff --git a/python/libxslt-python-api.xml b/python/libxslt-python-api.xml index 648f2614..a9e3d6aa 100644 --- a/python/libxslt-python-api.xml +++ b/python/libxslt-python-api.xml @@ -45,8 +45,8 @@ <arg name='URI' type='xmlChar *' info='the namespace or NULL'/> <arg name='c' type='pythonObject' info='the python class instance'/> </function> - <function name='xsltCleanup' file='python'> - <info>Cleanup all libxslt and libxml2 memory allocated</info> + <function name='xsltPythonCleanup' file='python'> + <info>Cleanup just libxslt (not libxml2) memory allocated</info> <return type='void'/> </function> <!-- xmlXPathParserContextPtr accessors --> diff --git a/python/libxslt.c b/python/libxslt.c index 78b4607d..6433626e 100644 --- a/python/libxslt.c +++ b/python/libxslt.c @@ -840,8 +840,8 @@ libxslt_xsltRegisterExtensionClass(PyObject *self ATTRIBUTE_UNUSED, ************************************************************************/ PyObject * -libxslt_xsltCleanup(PyObject *self ATTRIBUTE_UNUSED, - PyObject *args ATTRIBUTE_UNUSED) { +libxslt_xsltPythonCleanup(PyObject *self ATTRIBUTE_UNUSED, + PyObject *args ATTRIBUTE_UNUSED) { if (libxslt_extModuleFunctions != NULL) { xmlHashFree(libxslt_extModuleFunctions, deallocateCallback); @@ -856,7 +856,6 @@ libxslt_xsltCleanup(PyObject *self ATTRIBUTE_UNUSED, xmlHashFree(libxslt_extModuleClasses, deallocateClasse); } xsltCleanupGlobals(); - xmlCleanupParser(); Py_INCREF(Py_None); return(Py_None); } diff --git a/python/libxsltclass.txt b/python/libxsltclass.txt index 3130df5e..0a344167 100644 --- a/python/libxsltclass.txt +++ b/python/libxsltclass.txt @@ -17,7 +17,7 @@ unregisterExtModuleTopLevel() registerAllExtras() # functions from module python -cleanup() +pythonCleanup() registerErrorHandler() registerExtModuleElement() registerExtModuleFunction() |