From 9060f9ec8a6aac2acc01cbbc4fe47b627e813d0a Mon Sep 17 00:00:00 2001 From: fufesou <13586388+fufesou@users.noreply.github.com> Date: Thu, 26 Jun 2025 18:27:22 +0800 Subject: [PATCH] fix: linux tray, defunct process (#12177) Signed-off-by: fufesou --- src/tray.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tray.rs b/src/tray.rs index 98ce450e1..f36da2cec 100644 --- a/src/tray.rs +++ b/src/tray.rs @@ -21,6 +21,10 @@ pub fn start_tray() { return; } } + + #[cfg(target_os = "linux")] + crate::server::check_zombie(); + allow_err!(make_tray()); } @@ -99,9 +103,11 @@ fn make_tray() -> hbb_common::ResultType<()> { } #[cfg(target_os = "linux")] { - // Do not use "xdg-open", it won't read config + // Do not use "xdg-open", it won't read the config. if crate::dbus::invoke_new_connection(crate::get_uri_prefix()).is_err() { - crate::run_me::<&str>(vec![]).ok(); + if let Ok(task) = crate::run_me::<&str>(vec![]) { + crate::server::CHILD_PROCESS.lock().unwrap().push(task); + } } } };