mirror of https://github.com/2dust/v2rayN
parent
558e5bb340
commit
1ff4839be1
|
@ -283,7 +283,6 @@ namespace ServiceLib.ViewModels
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Logging.SaveLog("MyAppExit Begin");
|
Logging.SaveLog("MyAppExit Begin");
|
||||||
//if (blWindowsShutDown)
|
|
||||||
await SysProxyHandler.UpdateSysProxy(_config, true);
|
await SysProxyHandler.UpdateSysProxy(_config, true);
|
||||||
|
|
||||||
await ConfigHandler.SaveConfig(_config);
|
await ConfigHandler.SaveConfig(_config);
|
||||||
|
@ -297,7 +296,10 @@ namespace ServiceLib.ViewModels
|
||||||
catch { }
|
catch { }
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
_updateView?.Invoke(EViewAction.Shutdown, null);
|
if (!blWindowsShutDown)
|
||||||
|
{
|
||||||
|
_updateView?.Invoke(EViewAction.Shutdown, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ namespace v2rayN.Desktop.Views
|
||||||
private WindowNotificationManager? _manager;
|
private WindowNotificationManager? _manager;
|
||||||
private CheckUpdateView? _checkUpdateView;
|
private CheckUpdateView? _checkUpdateView;
|
||||||
private BackupAndRestoreView? _backupAndRestoreView;
|
private BackupAndRestoreView? _backupAndRestoreView;
|
||||||
|
private bool _blCloseByUser = false;
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
|
@ -279,6 +280,11 @@ namespace v2rayN.Desktop.Views
|
||||||
|
|
||||||
protected override async void OnClosing(WindowClosingEventArgs e)
|
protected override async void OnClosing(WindowClosingEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (_blCloseByUser)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Logging.SaveLog("OnClosing -> " + e.CloseReason.ToString());
|
Logging.SaveLog("OnClosing -> " + e.CloseReason.ToString());
|
||||||
|
|
||||||
switch (e.CloseReason)
|
switch (e.CloseReason)
|
||||||
|
@ -374,6 +380,8 @@ namespace v2rayN.Desktop.Views
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_blCloseByUser = true;
|
||||||
StorageUI();
|
StorageUI();
|
||||||
|
|
||||||
await ViewModel?.MyAppExitAsync(false);
|
await ViewModel?.MyAppExitAsync(false);
|
||||||
|
|
Loading…
Reference in New Issue