The Free Software Media System - Server Backend & API
fix windows restart hang
Luke Pulverenti459e483b4e9f
diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.csindex 39dd41356b..c2725e9bf6 100644--- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs+++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs@@ -158,9 +158,14 @@ namespace MediaBrowser.Common.Implementations.Securityreturn new SupporterInfo();}- var url = MbAdmin.HttpsUrl + "/service/supporter/retrieve?key=" + key;+ var data = new Dictionary<string, string>+ {+ { "key", key },+ };++ var url = MbAdmin.HttpsUrl + "/service/supporter/retrieve";- using (var stream = await _httpClient.Get(url, CancellationToken.None).ConfigureAwait(false))+ using (var stream = await _httpClient.Post(url, data, CancellationToken.None).ConfigureAwait(false)){var response = _jsonSerializer.DeserializeFromStream<SuppporterInfoResponse>(stream);@@ -269,4 +274,4 @@ namespace MediaBrowser.Common.Implementations.Security_isMbSupporterInitialized = false;}}-}+}\ No newline at end of filediff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.csindex 968172bc3a..d7b8b2aed4 100644--- a/MediaBrowser.ServerApplication/MainStartup.cs+++ b/MediaBrowser.ServerApplication/MainStartup.cs@@ -214,7 +214,7 @@ namespace MediaBrowser.ServerApplicationfileSystem,"MBServer",nativeApp);-+var initProgress = new Progress<double>();if (!runService)@@ -513,23 +513,19 @@ namespace MediaBrowser.ServerApplicationif (!_isRunningAsService){- _logger.Info("Hiding server notify icon");- _serverNotifyIcon.Visible = false;+ //_logger.Info("Hiding server notify icon");+ //_serverNotifyIcon.Visible = false;_logger.Info("Starting new instance");//Application.Restart();Process.Start(_appHost.ServerConfigurationManager.ApplicationPaths.ApplicationPath);- _logger.Info("Calling Environment.Exit");- Environment.Exit(0);+ ShutdownWindowsApplication();}}private static void ShutdownWindowsApplication(){- _logger.Info("Hiding server notify icon");- _serverNotifyIcon.Visible = false;-_logger.Info("Calling Application.Exit");Application.Exit();diff --git a/MediaBrowser.ServerApplication/ServerNotifyIcon.cs b/MediaBrowser.ServerApplication/ServerNotifyIcon.csindex 7257207319..ad0bd8a1af 100644--- a/MediaBrowser.ServerApplication/ServerNotifyIcon.cs+++ b/MediaBrowser.ServerApplication/ServerNotifyIcon.cs@@ -168,6 +168,19 @@ namespace MediaBrowser.ServerApplication}notifyIcon1.DoubleClick += notifyIcon1_DoubleClick;+ Application.ApplicationExit += Application_ApplicationExit;+ }++ void Application_ApplicationExit(object sender, EventArgs e)+ {+ try+ {+ notifyIcon1.Visible = false;+ }+ catch+ {++ }}void notifyIcon1_DoubleClick(object sender, EventArgs e)