Commit 6ef006b5 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#739 Solve the memory issue with gcc: destroy manually the singletons so that...

#739 Solve the memory issue with gcc: destroy manually the singletons so that there is no problem when it's done automatically. #740 has been assigned to periodically check whether the likely gcc issue has been lifted.
parent 57f5a1dc
......@@ -21,6 +21,8 @@
# include "FiniteElement/FiniteElementSpace/GodOfDofManager.hpp"
# include "FiniteElement/BoundaryConditions/Private/DirichletBoundaryConditionManager.hpp"
# include "FiniteElement/RefFiniteElement/Private/BasicRefFEltFactory.hpp" // only for #740...
# include "FiniteElement/BoundaryConditions/Private/ComponentFactory.hpp" // only for #740...
# include "Parameters/Instances/Fiber/Private/FiberListManager.hpp"
......
......@@ -199,9 +199,23 @@ namespace HappyHeart
// singletons.
Private::FiberListManager<ParameterNS::Type::scalar>::GetInstance().Destroy();
Private::FiberListManager<ParameterNS::Type::vector>::GetInstance().Destroy();
// Additional operations required by DerivedT.
static_cast<DerivedT&>(*this).SupplFinalize();
// #740 gcc 5.2 no longer seems able to correctly destroy the singletons after the end of the main program.
// A quite inelegant work-around is to destroy the underlying objects beforehand here.
DomainManager::GetInstance().Destroy();
GeometricMeshRegionManager::GetInstance().Destroy();
GodOfDofManager::GetInstance().Destroy();
TimeKeep::GetInstance().Destroy();
UnknownManager::GetInstance().Destroy();
Private::ComponentFactory::GetInstance().Destroy();
Private::DirichletBoundaryConditionManager::GetInstance().Destroy();
Private::GeometricEltFactory::GetInstance().Destroy();
Private::NumberingSubsetManager::GetInstance().Destroy();
RefFEltNS::Private::BasicRefFEltFactory::GetInstance().Destroy();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment