From 11f29361ebf80521b132198d16b2291c2f7d33c0 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Wed, 29 Jan 2025 21:07:43 -0600 Subject: [PATCH] misc: chore: [ci skip] Log errors from TaskScheduler.UnobservedTaskException --- src/Ryujinx/Program.cs | 8 +++++--- src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs index c72aa689a..5696e4cb3 100644 --- a/src/Ryujinx/Program.cs +++ b/src/Ryujinx/Program.cs @@ -112,7 +112,11 @@ namespace Ryujinx.Ava // Hook unhandled exception and process exit events. AppDomain.CurrentDomain.UnhandledException += (sender, e) => ProcessUnhandledException(sender, e.ExceptionObject as Exception, e.IsTerminating); + TaskScheduler.UnobservedTaskException += (sender, e) + => ProcessUnhandledException(sender, e.Exception, false); AppDomain.CurrentDomain.ProcessExit += (_, _) => Exit(); + + // Setup base data directory. AppDataManager.Initialize(CommandLineState.BaseDirPathArg); @@ -282,9 +286,7 @@ namespace Ryujinx.Ava log.PrintMsg(LogClass.Application, message); } - - - + if (isTerminating) Exit(); } diff --git a/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs b/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs index 67deb9723..0d280624a 100644 --- a/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs @@ -34,7 +34,6 @@ namespace Ryujinx.Ava.UI.Windows #if DEBUG this.AttachDevTools(new KeyGesture(Key.F12, KeyModifiers.Alt)); #endif - } public SettingsWindow()