From 7419c8614cc778e376b46044736b99122ae402d7 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 14 Oct 2020 20:41:58 +0300 Subject: [PATCH] #19943 Crash after selecting a non valid representation --- src/MEDCalc/cmp/MEDPresentation.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/MEDCalc/cmp/MEDPresentation.cxx b/src/MEDCalc/cmp/MEDPresentation.cxx index 5c2520732..8a0f209bc 100644 --- a/src/MEDCalc/cmp/MEDPresentation.cxx +++ b/src/MEDCalc/cmp/MEDPresentation.cxx @@ -123,13 +123,17 @@ MEDPresentation::~MEDPresentation() MEDPyLockWrapper lock; std::ostringstream oss; - oss << "pvs.Hide(" << _objVar << ", view=" << getRenderViewVar() << ");"; - execPyLine(oss.str()); - // :TRICKY: The two following lines raise an exception when closing MED module - // after sequence: MED - load file - PARAVIS - MED - close SALOME - // (see Mantis #23461) - //execPyLine(getRenderViewVar() + ".ResetCamera();"); - //execPyLine("pvs.Render();"); + try { + oss << "pvs.Hide(" << _objVar << ", view=" << getRenderViewVar() << ");"; + execPyLine(oss.str()); + // :TRICKY: The two following lines raise an exception when closing MED module + // after sequence: MED - load file - PARAVIS - MED - close SALOME + // (see Mantis #23461) + //execPyLine(getRenderViewVar() + ".ResetCamera();"); + //execPyLine("pvs.Render();"); + } + catch(SALOME::SALOME_Exception&) { + } } } -- 2.39.2