Пример #1
0
        public static void Exit()
        {
            try { SSLHelper.Dispose(); }
            catch (Exception e) {
                Log.Error("SSLHelper Dispose Exception", e);
            };
            Sounds.Close();
            try
            {
                Program.Client?.Rpc?.Leave(Player.LocalPlayer);
            }
            catch (Exception e)
            {
                Log.Error("Exit() Player leave exception", e);
            }
            UpdateManager.Instance.Stop();
            LogManager.Shutdown();
            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                if (LobbyClient != null)
                {
                    LobbyClient.Stop();
                }
                WindowManager.Shutdown();

                //Apparently this can be null sometimes?
                if (Application.Current != null)
                {
                    Application.Current.Shutdown(0);
                }
            }));
        }