1
0
Fork 0

make sure entries are actually erased :-)

This commit is contained in:
mfranz 2007-01-28 20:59:47 +00:00
parent 227e96afa6
commit c5cc84baeb

View file

@ -434,13 +434,11 @@ void FGNasalSys::update(double)
if(_purgeListeners) {
_purgeListeners = false;
map<int, FGNasalListener *>::iterator it;
for(it = _listener.end(); it != _listener.end();) {
for(it = _listener.end(); --it != _listener.end();) {
FGNasalListener *nl = it->second;
if(nl->_dead) {
_listener.erase(it--);
_listener.erase(it);
delete nl;
} else {
--it;
}
}
}