From 218c4a531b79ce9aa471fff41d825e92a232d912 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Mon, 7 Sep 2020 15:19:53 +0200 Subject: [PATCH] fix uninizialized area and maybe deleted value being appended pout3d may be deleted when array resizes, so copy it --- libsrc/meshing/meshclass.hpp | 2 +- libsrc/meshing/meshing2.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 59ed7b85..e3b45b9b 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -797,7 +797,7 @@ namespace netgen double area; public: CSurfaceArea (const Mesh & amesh) - : mesh(amesh), valid(false) { ; } + : mesh(amesh), valid(false), area(0.) { ; } void Add (const Element2d & sel) { diff --git a/libsrc/meshing/meshing2.cpp b/libsrc/meshing/meshing2.cpp index bda90593..edf4770d 100644 --- a/libsrc/meshing/meshing2.cpp +++ b/libsrc/meshing/meshing2.cpp @@ -675,7 +675,7 @@ namespace netgen plainpoints.Append (newpout); - const auto& pout3d = locpoints.Get(pouti); + auto pout3d = locpoints.Get(pouti); locpoints.Append (pout3d); plainzones.Append (0);