2dust 1 год назад
Родитель
Сommit
971aea50d7
2 измененных файлов с 2 добавлено и 3 удалено
  1. 0 2
      clashN/clashN/App.xaml.cs
  2. 2 1
      clashN/clashN/ViewModels/MainWindowViewModel.cs

+ 0 - 2
clashN/clashN/App.xaml.cs

@@ -20,7 +20,6 @@ namespace ClashN
             if (!bCreatedNew)
             {
                 ProgramStarted.Set();
-                App.Current.Shutdown();
                 Environment.Exit(-1);
                 return;
             }
@@ -65,7 +64,6 @@ namespace ClashN
             if (ConfigProc.LoadConfig(ref _config) != 0)
             {
                 UI.ShowWarning($"Loading GUI configuration file is abnormal,please restart the application{Environment.NewLine}加载GUI配置文件异常,请重启应用");
-                Application.Current.Shutdown();
                 Environment.Exit(0);
                 return;
             }

+ 2 - 1
clashN/clashN/ViewModels/MainWindowViewModel.cs

@@ -8,6 +8,7 @@ using NHotkey;
 using ReactiveUI;
 using ReactiveUI.Fody.Helpers;
 using Splat;
+using System.Diagnostics;
 using System.Drawing;
 using System.Reactive;
 using System.Reactive.Linq;
@@ -253,8 +254,8 @@ namespace ClashN.ViewModels
             catch { }
             finally
             {
-                Application.Current.Shutdown();
                 Environment.Exit(0);
+                Process.GetCurrentProcess().Kill();
             }
         }