--- modules/core/src/c/TerminateCore.c.orig 2009-03-05 20:04:34.000000000 +1100 +++ modules/core/src/c/TerminateCore.c 2009-03-05 20:04:39.000000000 +1100 @@ -9,6 +9,8 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ +#include + #include "TerminateCore.h" /*--------------------------------------------------------------------------*/ #include "realmain.h" /* Get_no_startup_flag */ @@ -54,6 +56,11 @@ /* Close all scilab's files */ TerminateScilabFilesList(); + /* + * Cleanup function for the XML library. + */ + xmlCleanupParser(); + /** clean tmpfiles **/ C2F(tmpdirc)(); --- modules/core/src/c/getmodules.c.orig 2009-03-05 20:04:35.000000000 +1100 +++ modules/core/src/c/getmodules.c 2009-03-05 20:04:39.000000000 +1100 @@ -222,10 +222,7 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); if(xpathCtxt) xmlXPathFreeContext(xpathCtxt); xmlFreeDoc (doc); - /* - * Cleanup function for the XML library. - */ - xmlCleanupParser(); + } else { --- modules/core/src/c/loadversion.c.orig 2009-03-05 20:04:35.000000000 +1100 +++ modules/core/src/c/loadversion.c 2009-03-05 20:04:39.000000000 +1100 @@ -133,10 +133,6 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); if(xpathCtxt) xmlXPathFreeContext(xpathCtxt); xmlFreeDoc (doc); - /* - * Cleanup function for the XML library. - */ - xmlCleanupParser(); } else { --- modules/core/src/c/readGateway.c.orig 2009-03-05 20:04:35.000000000 +1100 +++ modules/core/src/c/readGateway.c 2009-03-05 20:04:39.000000000 +1100 @@ -205,11 +205,6 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); if(xpathCtxt) xmlXPathFreeContext(xpathCtxt); xmlFreeDoc (doc); - - /* - * Cleanup function for the XML library. - */ - xmlCleanupParser(); } else { --- modules/jvm/src/c/getJvmOptions.c.orig 2009-03-05 20:04:28.000000000 +1100 +++ modules/jvm/src/c/getJvmOptions.c 2009-03-05 20:04:39.000000000 +1100 @@ -1,4 +1,3 @@ - /* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab * Copyright (C) 2008 - INRIA - Allan CORNET @@ -125,10 +124,11 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); if(xpathCtxt) xmlXPathFreeContext(xpathCtxt); xmlFreeDoc (doc); - /* - * Cleanup function for the XML library. - */ - xmlCleanupParser(); + + /* xmlCleanupParser is called in + * modules/core/src/c/TerminateCore.c + * since it needs to be done only once. + */ *size_JavaVMOption = indice; return jvm_options; --- modules/jvm/src/c/loadClasspath.c.orig 2009-03-05 20:04:35.000000000 +1100 +++ modules/jvm/src/c/loadClasspath.c 2009-03-05 20:04:39.000000000 +1100 @@ -168,10 +168,7 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); if(xpathCtxt) xmlXPathFreeContext(xpathCtxt); - /* - * Cleanup function for the XML library. - */ - xmlCleanupParser(); + } else { --- modules/jvm/src/c/loadLibrarypath.c.orig 2009-03-05 20:04:35.000000000 +1100 +++ modules/jvm/src/c/loadLibrarypath.c 2009-03-05 20:04:39.000000000 +1100 @@ -117,10 +117,6 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); if(xpathCtxt) xmlXPathFreeContext(xpathCtxt); xmlFreeDoc (doc); - /* - * Cleanup function for the XML library. - */ - xmlCleanupParser(); } else { --- modules/jvm/src/c/loadOnUseClassPath.c.orig 2009-03-05 20:04:35.000000000 +1100 +++ modules/jvm/src/c/loadOnUseClassPath.c 2009-03-05 20:04:39.000000000 +1100 @@ -113,10 +113,7 @@ } if(xpathObj) xmlXPathFreeObject(xpathObj); if(xpathCtxt) xmlXPathFreeContext(xpathCtxt); - /* - * Cleanup function for the XML library. - */ - xmlCleanupParser(); + } else {