1
0
Fork 0

simplify and fix

This commit is contained in:
fredb 2007-01-29 07:53:42 +00:00
parent b73bd53744
commit 17957439a1

View file

@ -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;
}
}
}