From d551b91182009849e785ce1b9cbcaaeeb326b946 Mon Sep 17 00:00:00 2001 From: Christoph Lehrenfeld Date: Tue, 19 May 2015 16:27:39 +0200 Subject: [PATCH] fix in curvedelems.cpp: * -> shared_ptr to secure destruction of glob. obj. --- libsrc/meshing/curvedelems.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index ef34ce5e..5e02fbfe 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -337,7 +337,7 @@ namespace netgen } - static Array jacpols2; + static Array> jacpols2; // compute face bubbles up to order n, 0 < y, y-x < 1, x+y < 1 @@ -451,8 +451,6 @@ namespace netgen CurvedElements :: ~CurvedElements() { - for (int i = 0; i < jacpols2.Size(); i++) - delete jacpols2[i]; jacpols2.SetSize(0); } @@ -631,7 +629,7 @@ namespace netgen { jacpols2.SetSize (100); for (int i = 0; i < 100; i++) - jacpols2[i] = new JacobiRecPol (100, i, 2); + jacpols2[i] = make_shared (100, i, 2); } PrintMessage (3, "Curving edges");