# HG changeset patch # User Patric Stout # Date 2021-05-11 10:32:27 # Node ID 2354652aa0d6b2ff08f58b3513094d2c3a0b810d # Parent f496fe4d307349a19ae4f5e5909ede1a82126111 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. diff --git a/src/network/network.cpp b/src/network/network.cpp --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -701,7 +701,6 @@ NetworkGameList *NetworkAddServer(const ClearGRFConfigList(&item->info.grfconfig); item->info.server_name = connection_string; - NetworkRebuildHostList(); UpdateNetworkGameWindow(); NetworkQueryServer(connection_string); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -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(); } }