(Attempt to) fix duplicate exception dialogs

This commit is contained in:
pizzaboxer 2023-08-06 14:24:17 +01:00
parent b6de3645b7
commit 53ccac4b37
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -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);