From 170a66625e98c92046905740e5cea1724618a084 Mon Sep 17 00:00:00 2001 From: Hongbro886 Date: Wed, 20 May 2026 05:54:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E6=97=B6=E5=8D=95=E5=AE=9E=E4=BE=8B=E6=A3=80=E6=9F=A5=E7=AB=9E?= =?UTF-8?q?=E6=80=81=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/view/main/window.py | 9 +++++---- main.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/view/main/window.py b/app/view/main/window.py index 19f04caa..1748ff3b 100644 --- a/app/view/main/window.py +++ b/app/view/main/window.py @@ -1220,10 +1220,11 @@ def restart_app(self): 执行安全验证后重启程序,清理所有资源""" logger.info("正在发起重启请求...") - if self.pre_class_reset_timer.isActive(): - self.pre_class_reset_timer.stop() - - self.cleanup_shortcuts() + self._stop_pre_class_reset_timer() + self._cleanup_shortcuts() + self._stop_ipc_client() + self._close_all_windows() + self._close_main_window() # 使用 EXIT_CODE_RESTART 退出码来触发重启 # main.py 中的 handle_exit() 函数会检测此退出码并执行重启逻辑 diff --git a/main.py b/main.py index c372ea02..1ca019c3 100644 --- a/main.py +++ b/main.py @@ -186,10 +186,10 @@ def initialize_application(): wm.app_start_time = time.perf_counter() - shared_memory, is_first_instance = check_single_instance() - time.sleep(PROCESS_EXIT_WAIT_SECONDS) + shared_memory, is_first_instance = check_single_instance() + return program_dir, shared_memory, is_first_instance