summaryrefslogtreecommitdiffstats
path: root/src/common/assert.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/assert.cpp')
-rw-r--r--src/common/assert.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/common/assert.cpp b/src/common/assert.cpp
index a27a025ae..b20c19123 100644
--- a/src/common/assert.cpp
+++ b/src/common/assert.cpp
@@ -6,9 +6,13 @@
#include "common/settings.h"
-void assert_handle_failure() {
- if (Settings::values.use_debug_asserts) {
- Crash();
+void assert_check_condition(bool cond, std::function<void()>&& on_failure) {
+ if (!cond) {
+ on_failure();
+
+ if (Settings::values.use_debug_asserts) {
+ Crash();
+ }
}
}