From: eap Date: Wed, 30 Nov 2011 13:47:05 +0000 (+0000) Subject: 0021422: EDF 1963 SMESH: Viscous layer algorithm fails in some cases X-Git-Tag: V6_4_0~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3b74875d9a9a3ad3ffffbb0d76eb90bd78f20987;p=modules%2Fsmesh.git 0021422: EDF 1963 SMESH: Viscous layer algorithm fails in some cases In NotifyListenersOnEvent(), enable removal of a listener from myEventListeners by its ProcessEvent() --- diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 73b130c91..73bd794f5 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -2073,11 +2073,17 @@ void SMESH_subMesh::NotifyListenersOnEvent( const int event, { map< EventListener*, EventListenerData* >::iterator l_d = myEventListeners.begin(); for ( ; l_d != myEventListeners.end(); ++l_d ) - if ( (*l_d).first->myBusySM.insert( this ).second ) + { + std::pair< EventListener*, EventListenerData* > li_da = *l_d; /* copy to enable removal + of a listener from + myEventListeners by + its ProcessEvent() */ + if ( li_da.first->myBusySM.insert( this ).second ) { - l_d->first->ProcessEvent( event, eventType, this, l_d->second, hyp ); - l_d->first->myBusySM.erase( this ); + li_da.first->ProcessEvent( event, eventType, this, li_da.second, hyp ); + li_da.first->myBusySM.erase( this ); } + } } //================================================================================