Salome HOME
23061: [CEA 1488] Import 1D-2D fails sometimes in relation with the source face discr...
[modules/smesh.git] / src / SMESH / SMESH_subMesh.cxx
index a7b015260631705e396ff8193615a2d1dd96fa5f..1d481713389949ea9a25e52312fb123c7e805267 100644 (file)
@@ -1861,10 +1861,13 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
       removeSubMeshElementsAndNodes();
       break;
     case SUBMESH_COMPUTED:      // allow retry compute
-      if (_algoState == HYP_OK)
-        _computeState = READY_TO_COMPUTE;
-      else
-        _computeState = NOT_READY;
+      if ( IsEmpty() ) // 23061
+      {
+        if (_algoState == HYP_OK)
+          _computeState = READY_TO_COMPUTE;
+        else
+          _computeState = NOT_READY;
+      }
       break;
     case SUBMESH_RESTORED:
       ComputeSubMeshStateEngine( SUBMESH_RESTORED );
@@ -2469,7 +2472,9 @@ void SMESH_subMesh::deleteOwnListeners()
   {
     if ( !_father->MeshExists( d->myMeshID ))
       continue;
-    if ( _father->GetId() == d->myMeshID && !_father->GetSubMeshContaining( d->mySubMeshID ))
+    if ( _father->GetId() == d->myMeshID &&
+         this->GetId()    != d->mySubMeshID &&
+         !_father->GetSubMeshContaining( d->mySubMeshID ))
       continue;
     d->mySubMesh->DeleteEventListener( d->myListener );
   }