fix for thread prevent process being closed (#21311)

This commit is contained in:
Davide Giacometti
2022-10-26 11:19:58 +02:00
committed by GitHub
parent 460f242967
commit 1ff5fa8794

View File

@@ -60,7 +60,7 @@ namespace Hosts
UnhandledException += App_UnhandledException; UnhandledException += App_UnhandledException;
new Thread(() => var cleanupBackupThread = new Thread(() =>
{ {
// Delete old backups only if running elevated // Delete old backups only if running elevated
if (!GetService<IElevationHelper>().IsElevated) if (!GetService<IElevationHelper>().IsElevated)
@@ -76,7 +76,10 @@ namespace Hosts
{ {
Logger.LogError("Failed to delete backup", ex); Logger.LogError("Failed to delete backup", ex);
} }
}).Start(); });
cleanupBackupThread.IsBackground = true;
cleanupBackupThread.Start();
} }
protected override void OnLaunched(LaunchActivatedEventArgs args) protected override void OnLaunched(LaunchActivatedEventArgs args)