Salome HOME
#19943 Crash after selecting a non valid representation V9_6_0b1
authorvsr <vsr@opencascade.com>
Wed, 14 Oct 2020 17:41:58 +0000 (20:41 +0300)
committervsr <vsr@opencascade.com>
Wed, 14 Oct 2020 17:41:58 +0000 (20:41 +0300)
src/MEDCalc/cmp/MEDPresentation.cxx

index 5c25207320dc7a767179c470558a337edd3b52b4..8a0f209bc6b5c34034b231dabd18cd9c03b7e52d 100644 (file)
@@ -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&) {
+    }
   }
 }