1.3.21.3.2
Android APK Release / Build Android APK (push) Successful in 55m29s

This commit is contained in:
2026-05-26 16:32:18 +08:00
parent 546cef5ba6
commit 17673b2862
89 changed files with 24098 additions and 272 deletions
+18
View File
@@ -8,6 +8,8 @@ import 'package:tray_manager/tray_manager.dart';
import '../config/app_config.dart';
import '../core/utils/app_logger.dart';
import '../presentation/providers/theme_provider.dart';
import 'sync_service.dart';
import '../src/rust/api/ffi.dart' as ffi;
/// 桌面端服务(窗口管理 + 系统托盘)
class DesktopService with TrayListener, WindowListener {
@@ -188,6 +190,22 @@ class DesktopService with TrayListener, WindowListener {
try {
AppLogger.d('DesktopService: Cleaning up before exit...');
// 同步引擎清理(WCF 模式下必须调用,同步释放占位符、注销 sync root)
try {
await SyncService.instance.stop();
AppLogger.d('DesktopService: Sync engine stopped');
} catch (e) {
AppLogger.e('DesktopService: Error stopping sync: $e');
}
// 进程退出前同步清理(确保 WCF 资源释放,不依赖 tokio runtime
try {
await ffi.syncShutdown();
AppLogger.d('DesktopService: Sync shutdown complete');
} catch (e) {
AppLogger.e('DesktopService: Error in sync shutdown: $e');
}
// 彻底解绑
windowManager.removeListener(this);
trayManager.removeListener(this);