diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index eab297934da6ffaa607404327bba1ef49dfd8ba8..61c6dd731a810e5709dac165861b5755c73aca2d 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -1393,6 +1393,10 @@ FieldManager::FieldManager() map_type_name["MaxEigenHessian"] = new FieldFactoryT<MaxEigenHessianField>(); background_field = -1; } +FieldManager::~FieldManager(){ + for ( std::map<std::string, FieldFactory*>::iterator it = map_type_name.begin(); it!=map_type_name.end(); it++) + delete it->second; +} #if defined(HAVE_POST) void Field::putOnNewView() diff --git a/Mesh/Field.h b/Mesh/Field.h index c920d42bdffee2563dc7cac7435688caf8b303c7..e4eaf0001b67d4595fc330121bebc1b5239b00e9 100644 --- a/Mesh/Field.h +++ b/Mesh/Field.h @@ -94,6 +94,7 @@ class FieldManager : public std::map<int, Field*> { int newId(); int maxId(); FieldManager(); + ~FieldManager(); int background_field; // compatibility with -bgm void setBackgroundMesh(int iView);