make sure entries are actually erased :-)
This commit is contained in:
parent
227e96afa6
commit
c5cc84baeb
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue