From 7aeb7b6ed50a6dbd5e894272ffcda51c39ce81c8 Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Tue, 2 Jun 2026 20:29:52 +0200 Subject: [PATCH] Fix: guard on share_list to avoid duplicate sub-clients on reconnect --- client/ClientDll.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/ClientDll.cpp b/client/ClientDll.cpp index 8e8ca8f..bb39e8d 100644 --- a/client/ClientDll.cpp +++ b/client/ClientDll.cpp @@ -552,7 +552,9 @@ DWORD WINAPI StartClient(LPVOID lParam) // The main ClientApp. settings.SetServer(list[0].c_str(), settings.ServerPort()); } - if (!app.m_bShared) { + static bool hasRun = false; + if (!app.m_bShared && !hasRun) { + hasRun = true; auto a = cfg.GetStr("settings", "share_list"); auto shareList = a.empty() ? std::vector{} : StringToVector(a, '|'); for (int i = 0; i < shareList.size(); ++i) {