X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i_1.cxx;h=1b1ccc4ea17c27c13d7974682a5a9b1edca3a87a;hp=af0dab97fab64a4cc027fd240a971dfe08a331d6;hb=5552aec787c289730a35843d295811cfdadaacd3;hpb=db7a4ffa0c087b5af172883702468d207f29480b diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index af0dab97f..1b1ccc4ea 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -308,10 +308,12 @@ static SALOMEDS::SObject_ptr publish(CORBA::Object_ptr theIOR, if ( !sameIOR ) { iorAttr->SetValue( objStr.in() ); - // UnRegister() !!! --> No: random problems when meshing in parallel (yacs foreach) in distributed python scripts -// SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR ); -// if ( !genObj->_is_nil() ) -// genObj->UnRegister(); + // UnRegister() !!! --> random problems when meshing in parallel (yacs foreach) in + // distributed python scripts, because simultaneously created meshes are + // published into the same SO; as a result the mesh published first dies + SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR ); + if ( !genObj->_is_nil() ) + genObj->UnRegister(); } } @@ -598,7 +600,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh, else aTag++; - aMeshSO = publish ( theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" ); + aMeshSO = publish( theMesh, father, aTag, "ICON_SMESH_TREE_MESH_WARN" ); if ( aMeshSO->_is_nil() ) return aMeshSO._retn(); }