mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-27 19:08:27 +01:00
fix windows restart hang
This commit is contained in:
@@ -214,7 +214,7 @@ namespace MediaBrowser.ServerApplication
|
||||
fileSystem,
|
||||
"MBServer",
|
||||
nativeApp);
|
||||
|
||||
|
||||
var initProgress = new Progress<double>();
|
||||
|
||||
if (!runService)
|
||||
@@ -513,23 +513,19 @@ namespace MediaBrowser.ServerApplication
|
||||
|
||||
if (!_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();
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user