this should now really be correct; nothing for a beauty contest, though
This commit is contained in:
parent
c5cc84baeb
commit
b73bd53744
1 changed files with 6 additions and 4 deletions
|
@ -433,11 +433,13 @@ void FGNasalSys::update(double)
|
|||
{
|
||||
if(_purgeListeners) {
|
||||
_purgeListeners = false;
|
||||
map<int, FGNasalListener *>::iterator it;
|
||||
for(it = _listener.end(); --it != _listener.end();) {
|
||||
FGNasalListener *nl = it->second;
|
||||
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;
|
||||
if(nl->_dead) {
|
||||
_listener.erase(it);
|
||||
_listener.erase((++eit).base());
|
||||
delete nl;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue