mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-25 14:11:14 +03:00
quit cm process if ipc connection to ipc server closed (#9292)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -625,7 +625,6 @@ pub async fn start_ipc<T: InvokeUiCM>(cm: ConnectionManager<T>) {
|
||||
OPTION_ENABLE_FILE_TRANSFER,
|
||||
&Config::get_option(OPTION_ENABLE_FILE_TRANSFER),
|
||||
));
|
||||
|
||||
match ipc::new_listener("_cm").await {
|
||||
Ok(mut incoming) => {
|
||||
while let Some(result) = incoming.next().await {
|
||||
@@ -647,7 +646,7 @@ pub async fn start_ipc<T: InvokeUiCM>(cm: ConnectionManager<T>) {
|
||||
log::error!("Failed to start cm ipc server: {}", err);
|
||||
}
|
||||
}
|
||||
crate::platform::quit_gui();
|
||||
quit_cm();
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
@@ -1042,3 +1041,11 @@ pub fn close_voice_call(id: i32) {
|
||||
allow_err!(client.tx.send(Data::CloseVoiceCall("".to_owned())));
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn quit_cm() {
|
||||
// in case of std::process::exit not work
|
||||
log::info!("quit cm");
|
||||
CLIENTS.write().unwrap().clear();
|
||||
crate::platform::quit_gui();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user