Merge pull request #3335 from fufesou/fix/toggle_clipboard_option_dead_lock

fix toggle clipboard dead lock
This commit is contained in:
RustDesk 2023-02-23 14:47:38 +08:00 committed by GitHub
commit 1452a601b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -1241,11 +1241,6 @@ impl LoginConfigHandler {
if !name.contains("block-input") {
self.save_config(config);
}
#[cfg(feature = "flutter")]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
if name == "disable-clipboard" {
crate::flutter::update_text_clipboard_required();
}
let mut misc = Misc::new();
misc.set_option(option);
let mut msg_out = Message::new();

View File

@ -165,9 +165,15 @@ pub fn session_reconnect(id: String, force_relay: bool) {
}
pub fn session_toggle_option(id: String, value: String) {
let mut is_found = false;
if let Some(session) = SESSIONS.write().unwrap().get_mut(&id) {
log::warn!("toggle option {}", value);
session.toggle_option(value);
is_found = true;
log::warn!("toggle option {}", &value);
session.toggle_option(value.clone());
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
if is_found && value == "disable-clipboard" {
crate::flutter::update_text_clipboard_required();
}
}