From 2e8bc3b2b025120798d2d3178e949b9969f705f5 Mon Sep 17 00:00:00 2001 From: Yoann Audouin Date: Thu, 15 Sep 2022 11:01:41 +0200 Subject: [PATCH] Better handle of deletion of temporary folder + missing delete of temporary SMESH_Mesh --- src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx | 1 - src/NETGENPlugin/NETGENPlugin_Runner.cxx | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx index 367c419..347f4c3 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx @@ -441,7 +441,6 @@ int NETGENPlugin_NETGEN_3D::RemoteCompute(SMESH_Mesh& aMesh, elapsed = std::chrono::duration_cast(time7-time5); std::cout << "Time for exec of add_in_mesh: " << elapsed.count() * 1e-9 << std::endl; - fs::remove_all(tmp_folder); aMesh.Unlock(); return true; diff --git a/src/NETGENPlugin/NETGENPlugin_Runner.cxx b/src/NETGENPlugin/NETGENPlugin_Runner.cxx index e69dcd5..a9b2a00 100644 --- a/src/NETGENPlugin/NETGENPlugin_Runner.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Runner.cxx @@ -194,7 +194,7 @@ int netgen3d(const std::string input_mesh_file, // Importing mesh SMESH_Gen gen; - SMESH_Mesh *myMesh = gen.CreateMesh(false); + std::unique_ptr myMesh(gen.CreateMesh(false)); //TODO: To define std::string mesh_name = "Maillage_1"; @@ -657,7 +657,8 @@ int netgen2d(const std::string input_mesh_file, // Importing mesh SMESH_Gen gen; - SMESH_Mesh *myMesh = gen.CreateMesh(false); + std::unique_ptr myMesh(gen.CreateMesh(false)); + //TODO: To define std::string mesh_name = "Maillage_1";