diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp index 8cee8b6a6a6567ba1dddc336bb99f410353967cf..a1fc73ac99d5691c3c286fe10c227eebf9c26a70 100644 --- a/Common/OpenFile.cpp +++ b/Common/OpenFile.cpp @@ -27,6 +27,7 @@ #if defined(HAVE_PARSER) #include "Parser.h" +#include "FunctionManager.h" #endif #if defined(HAVE_MESH) @@ -679,6 +680,7 @@ void OpenProject(const std::string &fileName, bool setWindowTitle) std::map<std::string, std::string> cls(Msg::GetCommandLineStrings()); for(std::map<std::string, std::string>::iterator it = cls.begin(); it != cls.end(); it++) gmsh_yystringsymbols[it->first] = it->second; + FunctionManager::Instance()->clear(); #endif // temporary hack until we fill the current GModel on the fly during parsing diff --git a/Parser/FunctionManager.cpp b/Parser/FunctionManager.cpp index 835452a99c499a04ed12eec231810f4005507060..d17141d32516011f9b2540890d72bdf52089cf6f 100644 --- a/Parser/FunctionManager.cpp +++ b/Parser/FunctionManager.cpp @@ -45,6 +45,11 @@ FunctionManager *FunctionManager::Instance() return instance; } +void FunctionManager::clear() +{ + functions->m.clear(); +} + int FunctionManager::enterFunction(const std::string &name, gmshFILE * f, std::string &filename, int &lno) const { diff --git a/Parser/FunctionManager.h b/Parser/FunctionManager.h index 328f6972c5c6a58fa8a372b57b58630ef3b7d5bb..c03882edd52dd2e0ed3264a49e986f0bd4d4aefd 100644 --- a/Parser/FunctionManager.h +++ b/Parser/FunctionManager.h @@ -27,6 +27,7 @@ class FunctionManager int enterFunction(const std::string &name, gmshFILE *f, std::string &filename, int &lineno) const; int leaveFunction(gmshFILE *f, std::string &filename, int &lineno); + void clear(); }; #endif