From 53ccac4b37eff76d04cd046e53e7985df44626f8 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Sun, 6 Aug 2023 14:24:17 +0100 Subject: [PATCH] (Attempt to) fix duplicate exception dialogs --- Bloxstrap/App.xaml.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 1651f21..d760390 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -49,6 +49,8 @@ namespace Bloxstrap ) ); + private static bool _showingExceptionDialog = false; + public static void Terminate(ErrorCode exitCode = ErrorCode.ERROR_SUCCESS) { if (IsFirstRun) @@ -85,6 +87,11 @@ namespace Bloxstrap #if DEBUG throw exception; #else + if (_showingExceptionDialog) + return; + + _showingExceptionDialog = true; + if (!IsQuiet) Controls.ShowExceptionDialog(exception);