Crash log: Suppress messages from internal faults

This commit is contained in:
Jonathan G Rennison
2023-06-12 21:26:43 +01:00
parent ad995cbebc
commit 8c507d6611
5 changed files with 19 additions and 4 deletions

View File

@@ -168,6 +168,8 @@ void CDECL usererror(const char *s, ...)
*/
void CDECL error(const char *s, ...)
{
if (CrashLog::HaveAlreadyCrashed()) DoOSAbort();
va_list va;
char buf[2048];
@@ -186,6 +188,8 @@ void CDECL error(const char *s, ...)
void CDECL assert_msg_error(int line, const char *file, const char *expr, const char *extra, const char *str, ...)
{
if (CrashLog::HaveAlreadyCrashed()) DoOSAbort();
va_list va;
char buf[2048];
@@ -200,7 +204,9 @@ void CDECL assert_msg_error(int line, const char *file, const char *expr, const
vseprintf(b, lastof(buf), str, va);
va_end(va);
ShowOSErrorBox(buf, true);
if (VideoDriver::GetInstance() == nullptr || VideoDriver::GetInstance()->HasGUI()) {
ShowOSErrorBox(buf, true);
}
/* Set the error message for the crash log and then invoke it. */
CrashLog::SetErrorMessage(buf);