assert/logging: Stop the logging thread and flush the backends before crashing

Co-Authored-By: SachinVin <26602104+SachinVin@users.noreply.github.com>
This commit is contained in:
FearlessTobi 2023-12-25 13:50:22 +01:00
parent 1a1af26031
commit 85ec46c7d1
3 changed files with 23 additions and 0 deletions

View file

@ -3,16 +3,19 @@
#include "common/assert.h"
#include "common/common_funcs.h"
#include "common/logging/backend.h"
#include "common/settings.h"
void assert_fail_impl() {
if (Settings::values.use_debug_asserts) {
Common::Log::Stop();
Crash();
}
}
[[noreturn]] void unreachable_impl() {
Common::Log::Stop();
Crash();
throw std::runtime_error("Unreachable code");
}