fix, separate window, event stream leak

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-08-07 09:01:31 +08:00
parent 6111042907
commit 7dcb28ce33
8 changed files with 41 additions and 26 deletions

View File

@@ -8,6 +8,7 @@ import 'package:ffi/ffi.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hbb/consts.dart';
import 'package:flutter_hbb/main.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:path_provider/path_provider.dart';
@@ -263,7 +264,8 @@ class PlatformFFI {
/// Start listening to the Rust core's events and frames.
void _startListenEvent(RustdeskImpl rustdeskImpl) {
var sink = rustdeskImpl.startGlobalEventStream(appType: _appType);
final appType = _appType == kAppTypeDesktopRemote ? '$_appType,$kWindowId' : _appType;
var sink = rustdeskImpl.startGlobalEventStream(appType: appType);
sink.listen((message) {
() async {
try {