From 9e7e87ce3e7a7a4f5373883550c6f05a5d023ab6 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Tue, 11 May 2021 12:32:27 +0200 Subject: 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. --- src/network/network.cpp | 1 - src/network/network_gui.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/network/network.cpp b/src/network/network.cpp index 2186cb8a1..29e66d932 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -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); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 2df40eeec..35597fa04 100644 --- 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(); } } -- cgit v1.2.3-70-g09d2