simplify and fix
This commit is contained in:
parent
b73bd53744
commit
17957439a1
1 changed files with 6 additions and 6 deletions
|
@ -433,14 +433,14 @@ void FGNasalSys::update(double)
|
|||
{
|
||||
if(_purgeListeners) {
|
||||
_purgeListeners = false;
|
||||
map<int, FGNasalListener *>::reverse_iterator it, eit;
|
||||
map<int, FGNasalListener *>::reverse_iterator end = _listener.rend();
|
||||
for(it = _listener.rbegin(); it != end; ) {
|
||||
eit = it++;
|
||||
FGNasalListener *nl = eit->second;
|
||||
map<int, FGNasalListener *>::iterator it;
|
||||
for ( it = _listener.begin(); it != _listener.end(); ) {
|
||||
FGNasalListener *nl = it->second;
|
||||
if(nl->_dead) {
|
||||
_listener.erase((++eit).base());
|
||||
_listener.erase( it++ );
|
||||
delete nl;
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue