Salome HOME
catch exceptions in "rate = algo->GetProgress();"
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index 486bea51b83b914bbef935696b316c1bed97388e..691b86b76dd8bbf17895aa8bb04645a815f9e335 100644 (file)
@@ -366,16 +366,10 @@ void SMESH_Mesh::Clear()
   {
     if ( SMESH_subMesh *sm = GetSubMeshContaining( GetShapeToMesh() ) )
     {
+      sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
+      sm->ComputeSubMeshStateEngine( SMESH_subMesh::CLEAN );
       sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
-      sm->ComputeStateEngine( SMESH_subMesh::CLEAN ); // for event listeners (issue 0020918)
-
-      SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/false,
-                                                               /*complexShapeFirst=*/true);
-      while ( smIt->more() )
-      {
-        sm = smIt->next();
-        sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
-      }
+      sm->ComputeSubMeshStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
     }
   }
   _isModified = false;
@@ -1492,7 +1486,17 @@ double SMESH_Mesh::GetComputeProgress() const
           algoDoneCost += smToCompute[i]->GetComputeCost();
         currentSubIds.Add( smToCompute[i]->GetId() );
       }
-      double rate = algo->GetProgress();
+      double rate = 0;
+      try
+      {
+        OCC_CATCH_SIGNALS;
+        rate = algo->GetProgress();
+      }
+      catch (...) {
+#ifdef _DEBUG_
+        cerr << "Exception in " << algo->GetName() << "::GetProgress()" << endl;
+#endif
+      }
       if ( 0. < rate && rate < 1.001 )
       {
         computedCost += rate * ( algoDoneCost + algoNotDoneCost );