diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 214e4a04..a2e6d470 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -747,9 +748,13 @@ ServerLobbyThread::Main() GetCallback().SignalNetServerError(e.GetErrorId(), e.GetOsErrorCode()); LOG_ERROR("Lobby exception: " << e.what()); } - // Clear all sessions. + // Clear all sessions and games. m_sessionManager.Clear(); m_gameSessionManager.Clear(); + BOOST_FOREACH(const GameMap::value_type& tmpGame, m_gameMap) { + tmpGame.second->Exit(); + } + m_gameMap.clear(); // Cancel pending timer callbacks. CancelTimers(); // Stop database engine.