BUG: MeshObject: do not release in destructor. Leave to regIOobject. Fixes #1276.

This commit is contained in:
mattijs
2019-04-15 15:06:57 +01:00
parent a554753db6
commit 17fe55a7c9

View File

@ -104,7 +104,10 @@ bool Foam::MeshObject<Mesh, MeshObjectType, Type>::Delete(const Mesh& mesh)
template<class Mesh, template<class> class MeshObjectType, class Type>
Foam::MeshObject<Mesh, MeshObjectType, Type>::~MeshObject()
{
MeshObjectType<Mesh>::release();
// We should not do a 'release' at this point since that will upset
// the destructor of regIOobject itself (which gets called after this).
// This now would no longer have the owned-by-registry setting so
// will not clean up after itself
}