diff options
Diffstat (limited to 'src/common/assert.cpp')
| -rw-r--r-- | src/common/assert.cpp | 10 |
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 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/settings.h" | 7 | #include "common/settings.h" |
| 8 | 8 | ||
| 9 | void assert_handle_failure() { | 9 | void assert_check_condition(bool cond, std::function<void()>&& on_failure) { |
| 10 | if (Settings::values.use_debug_asserts) { | 10 | if (!cond) { |
| 11 | Crash(); | 11 | on_failure(); |
| 12 | |||
| 13 | if (Settings::values.use_debug_asserts) { | ||
| 14 | Crash(); | ||
| 15 | } | ||
| 12 | } | 16 | } |
| 13 | } | 17 | } |
| 14 | 18 | ||