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:
FearlessTobiandSachinVin committed 2023-12-26 10:35:14 +01:00
1 parent 1a1af26031
commit 85ec46c7d1
3 files changed
+23

No files matched your search

+3
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");
}