From 9ebce0b2a6bd3cfbc327bb42243212117104b917 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 7 Nov 2007 09:43:35 +0000 Subject: [PATCH] PAL16202,16203 (Propagation 1D on edges group) remove useless includes and fix SetEventListener() --- src/SMESH/SMESH_subMesh.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index e47c030bf..67aeddf53 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -44,14 +44,13 @@ #include #include #include -#include #include #include -#include -#include #include #include #include +#include +#include #include #include @@ -1926,8 +1925,9 @@ void SMESH_subMesh::SetEventListener(EventListener* listener, EventListenerData* map< EventListener*, EventListenerData* >::iterator l_d = myEventListeners.find( listener ); if ( l_d != myEventListeners.end() ) { - if ( l_d->second && l_d->second->IsDeletable() ) - delete l_d->second; + EventListenerData* curData = l_d->second; + if ( curData && curData != data && curData->IsDeletable() ) + delete curData; l_d->second = data; } else @@ -2028,13 +2028,17 @@ void SMESH_subMeshEventListener::ProcessEvent(const int event, eventType == SMESH_subMesh::COMPUTE_EVENT) { ASSERT( data->mySubMeshes.front() != subMesh ); + list::iterator smIt = data->mySubMeshes.begin(); + list::iterator smEnd = data->mySubMeshes.end(); switch ( event ) { case SMESH_subMesh::CLEAN: - data->mySubMeshes.front()->ComputeStateEngine( event ); + for ( ; smIt != smEnd; ++ smIt) + (*smIt)->ComputeStateEngine( event ); break; case SMESH_subMesh::COMPUTE: if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK ) - data->mySubMeshes.front()->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED ); + for ( ; smIt != smEnd; ++ smIt) + (*smIt)->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED ); break; default:; } -- 2.39.2