wesnothd: avoid trying to remove destructed players from games during stack unwinding
This commit is contained in:
parent
a6923bfef0
commit
fb2d03fdba
2 changed files with 8 additions and 0 deletions
|
@ -588,6 +588,12 @@ public:
|
|||
*/
|
||||
bool is_reload() const;
|
||||
|
||||
void emergency_cleanup()
|
||||
{
|
||||
players_.clear();
|
||||
observers_.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
// forbidden operations
|
||||
game(const game&) = delete;
|
||||
|
|
|
@ -1387,6 +1387,8 @@ void server::cleanup_game(game* game_ptr)
|
|||
LOG_SERVER << "Could not find game (" << game_ptr->id() << ", " << game_ptr->db_id() << ") to delete in games_and_users_list_.\n";
|
||||
}
|
||||
|
||||
if(destructed) game_ptr->emergency_cleanup();
|
||||
|
||||
delete game_ptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue