]> git.mxchange.org Git - flightgear.git/commitdiff
make sure entries are actually erased :-)
authormfranz <mfranz>
Sun, 28 Jan 2007 20:59:47 +0000 (20:59 +0000)
committermfranz <mfranz>
Sun, 28 Jan 2007 20:59:47 +0000 (20:59 +0000)
src/Scripting/NasalSys.cxx

index 9e4a75ad1a8d3cc238b9951d85e13c75a8b6ae94..f4d6a5db3aa47608628ae8a0880ab58bf72957fc 100644 (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;
             }
         }
     }