Procházet zdrojové kódy

优化OnSessionEnded

felix před 1 rokem
rodič
revize
21d4c10bbd
1 změnil soubory, kde provedl 3 přidání a 4 odebrání
  1. 3 4
      Vinno.FIS.Sonopost/App.xaml.cs

+ 3 - 4
Vinno.FIS.Sonopost/App.xaml.cs

@@ -152,8 +152,6 @@ namespace Vinno.FIS.Sonopost
             }
         }
 
-       
-
         private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
         {
             Logger.WriteLineError($"DispatcherUnhandledException:{e.Exception}");
@@ -189,6 +187,8 @@ namespace Vinno.FIS.Sonopost
                 Logger.WriteLineWarn($"Sonopost OnSessionEnded Invoke");
                 _oledManager?.ShowStatus(OledMessage.ShutDown);
                 Dispose();
+                Thread.Sleep(1000);
+                Logger.WriteLineWarn("=======================Sonopost Shutdown=======================");
             }
             catch (Exception ex)
             {
@@ -196,7 +196,6 @@ namespace Vinno.FIS.Sonopost
             }
             finally
             {
-                Logger.WriteLineWarn("=======================Sonopost Shutdown=======================");
                 Process.GetCurrentProcess().Kill();
             }
         }
@@ -240,7 +239,7 @@ namespace Vinno.FIS.Sonopost
                         _networkManager.CurrentWifiLevelChanged -= OnCurrentWifiLevelChanged;
                         AppDomain.CurrentDomain.UnhandledException -= CurrentDomainUnhandledException;
                         SystemEvents.SessionEnded -= OnSessionEnded;
-                        if(_webHost!=null)
+                        if (_webHost != null)
                         {
                             _webHost.Dispose();
                             _webHost = null;