diff --git a/CHANGES.current b/CHANGES.current index b1070d3c7..458095d3d 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,9 @@ Version 1.3.41 (in progress) ============================ +2010-02-05: wsfulton + Fix #2894405 - assertion when using -xmlout. + 2010-01-28: wsfulton Fix typemap matching bug when a templated type has a typemap both specialized and not specialized. For example: diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index 34914efa3..201d42b93 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -25,7 +25,7 @@ char cvsroot_main_cxx[] = "$Id$"; // Global variables -Language *lang; // Language method +static Language *lang = 0; // Language method int CPlusPlus = 0; int Extend = 0; // Extend flag int ForceExtern = 0; // Force extern mode @@ -1231,6 +1231,8 @@ int SWIG_main(int argc, char *argv[], Language *l) { Swig_print_tree(Getattr(top, "module")); } if (dump_xml && top) { + delete lang; + lang = 0; Swig_print_xml(top, xmlout); } Delete(top); @@ -1265,6 +1267,9 @@ int SWIG_main(int argc, char *argv[], Language *l) { if ((werror) && (Swig_warn_count())) { return Swig_warn_count(); } + + delete lang; + return Swig_error_count(); } diff --git a/Source/Modules/swigmain.cxx b/Source/Modules/swigmain.cxx index 4208a8c6f..2acdffa9b 100644 --- a/Source/Modules/swigmain.cxx +++ b/Source/Modules/swigmain.cxx @@ -196,7 +196,8 @@ int main(int margc, char **margv) { dl = (fac) (); } } + int res = SWIG_main(argc, argv, dl); - delete dl; + return res; }