From 11122b385ef8fd6de57aebe7ef2e7f0c8a040281 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 5 Feb 2016 12:34:45 +0000 Subject: [PATCH] Bug fix: memory leak in block AMG --- src/foam/meshes/lduMesh/lduPrimitiveMesh.H | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/foam/meshes/lduMesh/lduPrimitiveMesh.H b/src/foam/meshes/lduMesh/lduPrimitiveMesh.H index 098403d18..f001de9d4 100644 --- a/src/foam/meshes/lduMesh/lduPrimitiveMesh.H +++ b/src/foam/meshes/lduMesh/lduPrimitiveMesh.H @@ -25,7 +25,8 @@ Class Foam::lduPrimitiveMesh Description - Simplest contrete lduMesh which stores the addressing needed bu lduMatrix. + Simplest contrete lduMesh which stores the addressing needed by the + lduMatrix. Addressing is contained locally \*---------------------------------------------------------------------------*/ @@ -115,7 +116,18 @@ public: // Destructor virtual ~lduPrimitiveMesh() - {} + { + // Clear interface pointers: they are not deleted + // by the lduInterfacePtrsList (derived from UPtrList) + // HJ, 5/Feb/2016 + forAll (interfaces_, i) + { + if (interfaces_.set(i)) + { + delete interfaces_(i); + } + } + } // Member Functions