Request restart asynchronously to avoid blocking update thread

This commit is contained in:
Dean Herbert 2024-09-02 16:43:46 +09:00
parent 42e1168b35
commit f8a6a6a8ae
No known key found for this signature in database
1 changed files with 4 additions and 10 deletions

View File

@ -5,6 +5,7 @@
using System.IO;
using System.Reflection;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using Microsoft.Win32;
using osu.Desktop.Performance;
using osu.Desktop.Security;
@ -18,6 +19,7 @@
using osu.Framework.Allocation;
using osu.Game.IO;
using osu.Game.IPC;
using osu.Game.Online.Multiplayer;
using osu.Game.Performance;
using osu.Game.Utils;
@ -105,17 +107,9 @@ protected override UpdateManager CreateUpdateManager()
public override bool RestartAppWhenExited()
{
try
{
Velopack.UpdateExe.Start();
Task.Run(() => Velopack.UpdateExe.Start()).FireAndForget();
return true;
}
catch (Exception e)
{
Logger.Error(e, "Failed to restart application");
return base.RestartAppWhenExited();
}
}
protected override void LoadComplete()
{