free ClassPathxmlDocPtr @ exit
Allan Cornet [Tue, 19 Aug 2008 04:16:33 +0000 (04:16 +0000)]
scilab/modules/jvm/src/c/TerminateJVM.c
scilab/modules/jvm/src/c/loadClasspath.c
scilab/modules/jvm/src/c/loadClasspath.h

index 22c00d3..6eba068 100644 (file)
 #include "TerminateJVM.h"
 #include "JVM.h"
 #include "createMainScilabObject.h"
+#include "loadClasspath.h"
 /*--------------------------------------------------------------------------*/ 
 BOOL TerminateJVM(void)
 {
+       freeClassPathxmlDocPtr();
        finishMainScilabObject();
        return finishJVM();
 }
index efba246..8614271 100644 (file)
@@ -37,6 +37,15 @@ xmlDocPtr getClassPathxmlDocPtr(void)
        return ClassPathxmlDocPtr;
 }
 /*--------------------------------------------------------------------------*/ 
+void freeClassPathxmlDocPtr(void)
+{
+       if (ClassPathxmlDocPtr)
+       {
+               xmlFreeDoc (ClassPathxmlDocPtr);
+               ClassPathxmlDocPtr = NULL;
+       }
+}
+/*--------------------------------------------------------------------------*/ 
 BOOL LoadClasspath(char *xmlfilename)
 {
        BOOL bOK = FALSE;
index 52eb4cd..ba4032f 100644 (file)
@@ -33,5 +33,10 @@ BOOL LoadClasspath(char *xmlfilename);
 */
 xmlDocPtr getClassPathxmlDocPtr(void);
 
+/**
+* free xmlDocPtr of classpath.xml
+*/
+void freeClassPathxmlDocPtr(void);
+
 #endif /* __LOADCLASSPATH_H__ */
 /*--------------------------------------------------------------------------*/