From defb336a7b658329ec245e5c3e47833802cb1d5e Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 18 Apr 2007 12:56:44 +0000 Subject: [PATCH] PAL13330 (When mesh generation does not success, trace where) Catch SIGSEGV in Netgen --- src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx index 560aef1..7a0eb7e 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx @@ -44,6 +44,9 @@ using namespace std; #include #include +#include +#include + #include "utilities.h" #include @@ -314,10 +317,16 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, Ng_Result status; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif status = Ng_GenerateVolumeMesh(Netgen_mesh, &Netgen_param); } + catch (Standard_Failure& exc) { + error(COMPERR_OCC_EXCEPTION, exc.GetMessageString()); + status = NG_VOLUME_FAILURE; + } catch (...) { - MESSAGE("An exception has been caught during the Volume Mesh Generation ..."); error(dfltErr(), "Exception in Ng_GenerateVolumeMesh()"); status = NG_VOLUME_FAILURE; } -- 2.39.2