fix: ensure app exits gracefully when an instance is already running

This commit is contained in:
Tunglies
2025-06-14 02:43:58 +08:00
parent 77fb40506f
commit 799783d3ef

View File

@@ -98,7 +98,7 @@ pub fn run() {
if result.is_err() { if result.is_err() {
logging!(info, Type::Setup, true, "检测到已有应用实例运行"); logging!(info, Type::Setup, true, "检测到已有应用实例运行");
if let Some(app_handle) = AppHandleManager::global().get() { if let Some(app_handle) = AppHandleManager::global().get() {
let _ = app_handle.exit(0); app_handle.exit(0);
} else { } else {
std::process::exit(0); std::process::exit(0);
} }