exit directly in rustdesk_core_main for macos
This commit is contained in:
parent
c66e8312de
commit
9fa9128892
@ -1,6 +1,5 @@
|
|||||||
import Cocoa
|
import Cocoa
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
import Foundation
|
|
||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import desktop_multi_window
|
import desktop_multi_window
|
||||||
// import bitsdojo_window_macos
|
// import bitsdojo_window_macos
|
||||||
@ -22,10 +21,7 @@ import texture_rgba_renderer
|
|||||||
|
|
||||||
class MainFlutterWindow: NSWindow {
|
class MainFlutterWindow: NSWindow {
|
||||||
override func awakeFromNib() {
|
override func awakeFromNib() {
|
||||||
if (!rustdesk_core_main()){
|
rustdesk_core_main();
|
||||||
Process.terminate()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let flutterViewController = FlutterViewController.init()
|
let flutterViewController = FlutterViewController.init()
|
||||||
let windowFrame = self.frame
|
let windowFrame = self.frame
|
||||||
self.contentViewController = flutterViewController
|
self.contentViewController = flutterViewController
|
||||||
|
@ -67,8 +67,12 @@ lazy_static::lazy_static! {
|
|||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn rustdesk_core_main() -> bool {
|
pub extern "C" fn rustdesk_core_main() -> bool {
|
||||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
return crate::core_main::core_main().is_some();
|
if crate::core_main::core_main().is_some() {
|
||||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
return true;
|
||||||
|
} else {
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
std::process::exit(0);
|
||||||
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user