mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
legacy mode, win, fix layout code simulation
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -4,11 +4,15 @@ pub mod linux;
|
||||
#[cfg(target_os = "macos")]
|
||||
pub mod macos;
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
use crate::{config::Config, log};
|
||||
#[cfg(not(debug_assertions))]
|
||||
use std::process::exit;
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
static mut GLOBAL_CALLBACK: Option<Box<dyn Fn()>> = None;
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
extern "C" fn breakdown_signal_handler(sig: i32) {
|
||||
let mut stack = vec![];
|
||||
backtrace::trace(|frame| {
|
||||
@@ -61,13 +65,13 @@ extern "C" fn breakdown_signal_handler(sig: i32) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
pub fn register_breakdown_handler<T>(_callback: T)
|
||||
#[cfg(not(debug_assertions))]
|
||||
pub fn register_breakdown_handler<T>(callback: T)
|
||||
where
|
||||
T: Fn() + 'static,
|
||||
{
|
||||
#[cfg(not(debug_assertions))]
|
||||
unsafe {
|
||||
GLOBAL_CALLBACK = Some(Box::new(_callback));
|
||||
GLOBAL_CALLBACK = Some(Box::new(callback));
|
||||
libc::signal(libc::SIGSEGV, breakdown_signal_handler as _);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user