diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-31 12:43:43 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-31 12:43:43 +0000 |
commit | 3da609588ad6fe7eb0581e4678a2ec8c6c1c4a18 (patch) | |
tree | 6824ff50935275424156f34fd5ec7912c1f4b055 /src/core/gameinterface.cc | |
parent | 02f6bfcef4f2e8b0fdbf12c652ab202edbeed19a (diff) |
more heisenbugs fixes
Diffstat (limited to 'src/core/gameinterface.cc')
-rw-r--r-- | src/core/gameinterface.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/gameinterface.cc b/src/core/gameinterface.cc index 7833bf5..ecb58fc 100644 --- a/src/core/gameinterface.cc +++ b/src/core/gameinterface.cc @@ -83,18 +83,22 @@ void GameInterface::clear() Zone::registry().clear(); // remove all game functions - for (Func::Registry::iterator it = Func::registry().begin(); it != Func::registry().end(); it++) { + for (Func::Registry::iterator it = Func::registry().begin(); it != Func::registry().end();) { if ( ((*it).second->flags() & Func::Game) == Func::Game) { delete (*it).second; - Func::registry().erase(it); + Func::registry().erase(it++); + } else { + ++it; } } // remove all game cvars - for (Cvar::Registry::iterator it = Cvar::registry().begin(); it != Cvar::registry().end(); it++) { + for (Cvar::Registry::iterator it = Cvar::registry().begin(); it != Cvar::registry().end(); ) { if ( ((*it).second->flags() & Cvar::Game) == Cvar::Game) { delete (*it).second; - Cvar::registry().erase(it); + Cvar::registry().erase(it++); + } else { + ++it; } } |