Commit 6eee10fc authored by Pavel Vainerman's avatar Pavel Vainerman

Немного переделал код, где используется erase в цикле

parent 3dc76a38
...@@ -385,7 +385,7 @@ void ModbusTCPServer::sessionFinished( ModbusTCPSession* s ) ...@@ -385,7 +385,7 @@ void ModbusTCPServer::sessionFinished( ModbusTCPSession* s )
{ {
slist.erase(i); slist.erase(i);
sessCount--; sessCount--;
break; return;
} }
} }
} }
......
...@@ -426,7 +426,7 @@ void IONotifyController::send( ConsumerListInfo& lst, UniSetTypes::SensorMessage ...@@ -426,7 +426,7 @@ void IONotifyController::send( ConsumerListInfo& lst, UniSetTypes::SensorMessage
if( maxAttemtps>0 && --(li->attempt) <= 0 ) if( maxAttemtps>0 && --(li->attempt) <= 0 )
{ {
li = lst.clst.erase(li); li = lst.clst.erase(li);
if( li == lst.clst.end() ) --li; --li;
break; break;
} }
......
...@@ -86,10 +86,10 @@ timeout_t LT_Object::checkTimers( UniSetObject* obj ) ...@@ -86,10 +86,10 @@ timeout_t LT_Object::checkTimers( UniSetObject* obj )
if( !li->curTick ) if( !li->curTick )
{ {
li = tlst.erase(li); li = tlst.erase(li);
if( li == tlst.end() ) --li; --li;
if( tlst.empty() ) if( tlst.empty() )
sleepTime = UniSetTimer::WaitUpTime; sleepTime = UniSetTimer::WaitUpTime;
continue; continue;
} }
else if(li->curTick>0 ) else if(li->curTick>0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment