From d471336994e6a3f17ad9c7653f0504a76a440038 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:31:13 +0800 Subject: [PATCH] Adjust App Exit function https://github.com/2dust/v2rayN/issues/6634 --- v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 784f7393..295b5364 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -287,14 +287,15 @@ namespace ServiceLib.ViewModels try { Logging.SaveLog("MyAppExitAsync Begin"); + + await SysProxyHandler.UpdateSysProxy(_config, true); MessageBus.Current.SendMessage("", EMsgCommand.AppExit.ToString()); await ConfigHandler.SaveConfig(_config); - await SysProxyHandler.UpdateSysProxy(_config, true); await ProfileExHandler.Instance.SaveTo(); await StatisticsHandler.Instance.SaveTo(); - StatisticsHandler.Instance.Close(); await CoreHandler.Instance.CoreStop(); + StatisticsHandler.Instance.Close(); Logging.SaveLog("MyAppExitAsync End"); }