From c5cc84baeb4f122a20d79d2f57aa3981ac3ebd6c Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 28 Jan 2007 20:59:47 +0000 Subject: [PATCH] make sure entries are actually erased :-) --- src/Scripting/NasalSys.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 9e4a75ad1..f4d6a5db3 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -434,13 +434,11 @@ void FGNasalSys::update(double) if(_purgeListeners) { _purgeListeners = false; map::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; } } }