convenience change try to avoid calling libxml2 cleanup function directly
authorDaniel Veillard <veillard@src.gnome.org>
Fri, 2 Jul 2004 13:53:31 +0000 (13:53 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Fri, 2 Jul 2004 13:53:31 +0000 (13:53 +0000)
* 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

ChangeLog
configure.in
python/libxsl.py
python/libxslt-python-api.xml
python/libxslt.c
python/libxsltclass.txt

index 58f975d..7375a56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Jul  2 15:51:49 CEST 2004 Daniel Veillard <daniel@veillard.com>
+
+       * 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.
+
 Fri Jul  2 16:24:12 HKT 2004 William Brack <wbrack@mmm.com.hk>
 
        * libxslt/keys.c: added namespace setup before calling XPath
index 770cf3c..5056c34 100644 (file)
@@ -388,7 +388,7 @@ if test "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ; then
     DV_LINK="1"
     XSLTPROCDV="xsltproc.dv"
     INSTALLED_XSLT_LIB=""
-   # PYTHONSODV="libxsltmod.so.dv"
+    LIBXML_SRC="../../XML/"
 fi
 
 WIN32_EXTRA_LIBADD=
index aa0ba43..404b1dc 100644 (file)
@@ -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
 #
index 648f261..a9e3d6a 100644 (file)
@@ -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 -->
index 78b4607..6433626 100644 (file)
@@ -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);
 }
index 3130df5..0a34416 100644 (file)
@@ -17,7 +17,7 @@ unregisterExtModuleTopLevel()
 registerAllExtras()
 
 # functions from module python
-cleanup()
+pythonCleanup()
 registerErrorHandler()
 registerExtModuleElement()
 registerExtModuleFunction()