exit directly in rustdesk_core_main for macos

This commit is contained in:
rustdesk 2023-06-28 12:05:27 +08:00
parent c66e8312de
commit 9fa9128892
2 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,5 @@
import Cocoa
import AVFoundation
import Foundation
import FlutterMacOS
import desktop_multi_window
// import bitsdojo_window_macos
@ -22,10 +21,7 @@ import texture_rgba_renderer
class MainFlutterWindow: NSWindow {
override func awakeFromNib() {
if (!rustdesk_core_main()){
Process.terminate()
return
}
rustdesk_core_main();
let flutterViewController = FlutterViewController.init()
let windowFrame = self.frame
self.contentViewController = flutterViewController

View File

@ -67,8 +67,12 @@ lazy_static::lazy_static! {
#[no_mangle]
pub extern "C" fn rustdesk_core_main() -> bool {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
return crate::core_main::core_main().is_some();
#[cfg(any(target_os = "android", target_os = "ios"))]
if crate::core_main::core_main().is_some() {
return true;
} else {
#[cfg(target_os = "macos")]
std::process::exit(0);
}
false
}