tmp commit

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-07-09 00:41:23 +08:00
parent 8bb851704a
commit 32c349dd8b
4 changed files with 20 additions and 7 deletions

View File

@ -40,7 +40,6 @@ class _DesktopServerPageState extends State<DesktopServerPage>
@override
void dispose() {
bind.cmClear();
windowManager.removeListener(this);
super.dispose();
}

View File

@ -233,7 +233,7 @@ class PlatformFFI {
'_appType:$_appType,info1-id:$id,info2-name:$name,dir:$_dir');
}
if (desktopType == DesktopType.cm) {
await _ffiBind.cmStartListenIpcThread();
await _ffiBind.cmInit();
}
await _ffiBind.mainDeviceId(id: id);
await _ffiBind.mainDeviceName(name: name);

View File

@ -910,7 +910,7 @@ pub mod connection_manager {
#[inline]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub fn start_listen_ipc_thread() {
fn start_listen_ipc_thread() {
start_listen_ipc(true);
}
@ -931,8 +931,22 @@ pub mod connection_manager {
}
}
#[cfg(target_os = "windows")]
extern "C" fn cm_clear_hook() {
#[cfg(target_os = "windows")]
crate::privacy_win_mag::stop();
}
#[inline]
pub fn cm_init() {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
start_listen_ipc_thread();
#[cfg(target_os = "windows")]
shutdown_hooks::add_shutdown_hook(cm_clear_hook);
}
#[inline]
pub fn cm_clear() {
#[cfg(target_os = "windows")]
crate::privacy_win_mag::stop();
}

View File

@ -1448,13 +1448,13 @@ pub fn main_use_texture_render() -> SyncReturn<bool> {
}
}
pub fn cm_start_listen_ipc_thread() {
pub fn cm_init() {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
crate::flutter::connection_manager::start_listen_ipc_thread();
crate::flutter::connection_manager::cm_init();
}
pub fn cm_clear() {
#[cfg(target_os = "windows")]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
crate::flutter::connection_manager::cm_clear();
}