quit cm process if ipc connection to ipc server closed (#9292)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2024-09-08 12:37:41 +08:00
committed by GitHub
parent c8cd564e69
commit 993862c103
4 changed files with 23 additions and 3 deletions

View File

@@ -1138,6 +1138,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
)
))]
let mut enable_file_transfer = "".to_owned();
let is_cm = crate::common::is_cm();
loop {
if let Ok(mut c) = ipc::connect(1000, "").await {
@@ -1148,6 +1149,9 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
match res {
Err(err) => {
log::error!("ipc connection closed: {}", err);
if is_cm {
crate::ui_cm_interface::quit_cm();
}
break;
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]