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) {
|
if(_purgeListeners) {
|
||||||
_purgeListeners = false;
|
_purgeListeners = false;
|
||||||
map<int, FGNasalListener *>::iterator it;
|
map<int, FGNasalListener *>::reverse_iterator it, eit;
|
||||||
for(it = _listener.end(); --it != _listener.end();) {
|
map<int, FGNasalListener *>::reverse_iterator end = _listener.rend();
|
||||||
FGNasalListener *nl = it->second;
|
for(it = _listener.rbegin(); it != end; ) {
|
||||||
|
eit = it++;
|
||||||
|
FGNasalListener *nl = eit->second;
|
||||||
if(nl->_dead) {
|
if(nl->_dead) {
|
||||||
_listener.erase(it);
|
_listener.erase((++eit).base());
|
||||||
delete nl;
|
delete nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue