[*] I really shouldn't risk a force flush here, but let's try it, it might work

This commit is contained in:
Reece Wilson 2022-01-28 01:16:14 +00:00
parent 3f2f66f4ec
commit 9df677cab9

View File

@ -16,7 +16,7 @@
#include "Debug.hpp"
#include <Source/Telemetry/Telemetry.hpp>
#include <Source/Console/Flusher.hpp>
namespace Aurora::Debug
{
@ -160,6 +160,7 @@ namespace Aurora::Debug
void PlatformHandleFatal(bool fatal)
{
static bool forceFail {false};
_EXCEPTION_POINTERS ptrs;
StackTrace ret;
CONTEXT ctx;
@ -169,6 +170,11 @@ namespace Aurora::Debug
Debug::Panic();
}
if (!AuExchange(forceFail, true))
{
Console::ForceFlush();
}
ptrs.ExceptionRecord = {};
ptrs.ContextRecord = &ctx;
HandleFatal(fatal, &ptrs);