mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-13 20:03:46 +00:00
fix: clear UPNP port mapping when exist app (#624)
This commit is contained in:
22 files changed
+506
-320
No files matched your search
@@ -17,6 +17,7 @@ import 'package:window_manager/window_manager.dart';
|
||||
import '../../../../api/api.dart';
|
||||
import '../../../../api/model/downloader_config.dart';
|
||||
import '../../../../core/common/start_config.dart';
|
||||
import '../../../../core/libgopeed_boot.dart';
|
||||
import '../../../../database/database.dart';
|
||||
import '../../../../database/entity.dart';
|
||||
import '../../../../i18n/message.dart';
|
||||
@@ -110,6 +111,7 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
||||
void onClose() {
|
||||
_linkSubscription?.cancel();
|
||||
trayManager.removeListener(this);
|
||||
LibgopeedBoot.instance.stop();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -240,7 +242,14 @@ class AppController extends GetxController with WindowListener, TrayListener {
|
||||
MenuItem.separator(),
|
||||
MenuItem(
|
||||
label: 'exit'.tr,
|
||||
onClick: (menuItem) => {windowManager.destroy()},
|
||||
onClick: (menuItem) async {
|
||||
try {
|
||||
await LibgopeedBoot.instance.stop();
|
||||
} catch (e) {
|
||||
logger.w("libgopeed stop fail", e);
|
||||
}
|
||||
windowManager.destroy();
|
||||
},
|
||||
),
|
||||
]);
|
||||
if (!Util.isLinux()) {
|
||||
|
||||
Reference in new issue
Block a user