In TSearchersDeleter fix setting/removing the event listener
This commit is contained in:
eap 2013-11-29 08:45:55 +00:00
parent df70ba0baf
commit ccb0d68b6f

View File

@ -227,22 +227,22 @@ namespace MeshEditor_I {
}
myMesh = mesh;
myMeshPartIOR = meshPartIOR;
if ( SMESH_subMesh* myMainSubMesh = mesh->GetSubMeshContaining(1) ) {
const TDependsOnMap & subMeshes = myMainSubMesh->DependsOn();
TDependsOnMap::const_iterator sm;
for (sm = subMeshes.begin(); sm != subMeshes.end(); sm++)
sm->second->SetEventListener( this, 0, sm->second );
SMESH_subMesh* sm = mesh->GetSubMesh( mesh->GetShapeToMesh() );
SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator( /*includeSelf=*/true );
while ( smIt->more() )
{
sm = smIt->next();
sm->SetEventListener( this, 0, sm );
}
}
}
//!< delete self from all submeshes
void Unset(SMESH_Mesh* mesh)
{
if ( SMESH_subMesh* myMainSubMesh = mesh->GetSubMeshContaining(1) ) {
const TDependsOnMap & subMeshes = myMainSubMesh->DependsOn();
TDependsOnMap::const_iterator sm;
for (sm = subMeshes.begin(); sm != subMeshes.end(); sm++)
sm->second->DeleteEventListener( this );
if ( SMESH_subMesh* sm = mesh->GetSubMeshContaining(1) ) {
SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator( /*includeSelf=*/true );
while ( smIt->more() )
smIt->next()->DeleteEventListener( this );
}
myMesh = 0;
}