Fix: [Network] don't rebuild the host-list during iterating the list (#9240)

Additionally, only rebuild it when we added a new manual server,
as otherwise it is a noop anyway.
This commit is contained in:
Patric Stout 2021-05-11 12:32:27 +02:00 committed by GitHub
parent 9841ebb0bd
commit 9e7e87ce3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 1 deletions

View File

@ -701,7 +701,6 @@ NetworkGameList *NetworkAddServer(const std::string &connection_string, bool man
ClearGRFConfigList(&item->info.grfconfig);
item->info.server_name = connection_string;
NetworkRebuildHostList();
UpdateNetworkGameWindow();
NetworkQueryServer(connection_string);

View File

@ -830,6 +830,7 @@ public:
if (!StrEmpty(str)) {
strecpy(_settings_client.network.connect_to_ip, str, lastof(_settings_client.network.connect_to_ip));
NetworkAddServer(str);
NetworkRebuildHostList();
}
}