wesnothd: avoid invalid iterator use when terminating game

Set game::owner_ to past-the-end iterator when game is being destroyed
to avoid comparison with invalid iterator when remove_player() is called
for other players after game host has disconnected making game::owner_
invalid.
This commit is contained in:
loonycyborg 2021-07-16 17:42:04 +03:00
parent 12d4129aca
commit e5a0400721
No known key found for this signature in database
GPG key ID: 6E8233FAB8F26D61

View file

@ -1450,6 +1450,7 @@ bool game::remove_player(player_iterator player, const bool disconnect, const bo
}
if(game_ended || destruct) {
owner_ = player_connections_.end();
return game_ended;
}