From: eap Date: Fri, 15 Nov 2013 15:24:18 +0000 (+0000) Subject: Regression of SALOME_TESTS/Grids/smesh/imps_08/I8 X-Git-Tag: V7_3_0a1~52 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=2ec7f35acedb4734ca755bd095a5504440e875f8 Regression of SALOME_TESTS/Grids/smesh/imps_08/I8 --- diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 6b3da9a34..929da0dcf 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -4249,10 +4249,13 @@ bool _pySelfEraser::CanClear() { int nbCalls = 0; std::list< Handle(_pyCommand) >& cmds = GetProcessedCmds(); - std::list< Handle(_pyCommand) >::const_iterator cmd = cmds.begin(); - for ( ; cmd != cmds.end(); ++cmd ) + std::list< Handle(_pyCommand) >::iterator cmd = cmds.begin(); + for ( ; cmd != cmds.end(); ) // check of cmd emptiness is not enough as object can change - nbCalls += ( ( *cmd )->GetString().Search( GetID() ) > 0 ); + if (( *cmd )->GetString().Search( GetID() ) > 0 ) + ++nbCalls, ++cmd; + else + cmd = cmds.erase( cmd ); // save the cmd from clearing toErase = ( nbCalls < 1 ); }