Salome HOME
Fix to avoid dependence of mesh on itself (it leaded to cycle in 'SetRemovedFromStudy').
authorakl <akl@opencascade.com>
Wed, 24 Apr 2013 13:13:40 +0000 (13:13 +0000)
committerakl <akl@opencascade.com>
Wed, 24 Apr 2013 13:13:40 +0000 (13:13 +0000)
src/SMESH_I/SMESH_2smeshpy.cxx

index 7d5e9f23ee9278956160791b4f65f8d9431f4858..20cc26043e36127d0f88380b1313a36392ec0def 100644 (file)
@@ -2011,7 +2011,7 @@ void _pyMesh::ClearCommands()
 
 void _pyMesh::addFatherMesh( const _pyID& meshID )
 {
 
 void _pyMesh::addFatherMesh( const _pyID& meshID )
 {
-  if ( !meshID.IsEmpty() )
+  if ( !meshID.IsEmpty() && meshID != GetID() )
     addFatherMesh( Handle(_pyMesh)::DownCast( theGen->FindObject( meshID )));
 }
 
     addFatherMesh( Handle(_pyMesh)::DownCast( theGen->FindObject( meshID )));
 }
 
@@ -2023,7 +2023,7 @@ void _pyMesh::addFatherMesh( const _pyID& meshID )
 
 void _pyMesh::addFatherMesh( const Handle(_pyMesh)& mesh )
 {
 
 void _pyMesh::addFatherMesh( const Handle(_pyMesh)& mesh )
 {
-  if ( !mesh.IsNull() )
+  if ( !mesh.IsNull() && mesh->GetID() != GetID() )
   {
     //myFatherMeshes.push_back( mesh );
     mesh->myChildMeshes.push_back( this );
   {
     //myFatherMeshes.push_back( mesh );
     mesh->myChildMeshes.push_back( this );