atexit crash on mac

This commit is contained in:
rustdesk 2021-08-10 12:19:42 +08:00
parent e510d2744d
commit c3a3c1a1c7
2 changed files with 1 additions and 2 deletions

View File

@ -218,8 +218,6 @@ pub fn fix_key_down_timeout_loop() {
std::thread::sleep(std::time::Duration::from_millis(300));
fix_key_down_timeout(false);
});
// atexit is called before exit
unsafe { libc::atexit(fix_key_down_timeout_at_exit) };
unsafe {
libc::signal(libc::SIGINT, fix_key_down_timeout_at_signal as _);
}

View File

@ -360,6 +360,7 @@ impl UI {
}
fn save_size(&mut self, x: i32, y: i32, w: i32, h: i32) {
crate::server::input_service::fix_key_down_timeout_at_exit();
Config::set_size(x, y, w, h);
}