diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-12-03 20:36:47 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-12-03 22:11:46 +0100 |
commit | 5761b90f3c7d66f5a93aef57e6a21feb807d24bf (patch) | |
tree | 089a15ec44225a898cc6138228c2ee3d84c56560 /core/core_bind.cpp | |
parent | ea66ea9060272d67fbf0c4264acb76a7bedfc4af (diff) | |
download | redot-engine-5761b90f3c7d66f5a93aef57e6a21feb807d24bf.tar.gz |
Add an `OS.crash()` method for testing system crash handler
This makes it possible to test the system's crash handler without
having to modify engine code or exploit an engine bug.
Diffstat (limited to 'core/core_bind.cpp')
-rw-r--r-- | core/core_bind.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 0bf6efc96d..e71c7648e8 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -207,6 +207,10 @@ void OS::alert(const String &p_alert, const String &p_title) { ::OS::get_singleton()->alert(p_alert, p_title); } +void OS::crash(const String &p_message) { + CRASH_NOW_MSG(p_message); +} + String OS::get_executable_path() const { return ::OS::get_singleton()->get_executable_path(); } @@ -542,6 +546,7 @@ void OS::_bind_methods() { ClassDB::bind_method(D_METHOD("close_midi_inputs"), &OS::close_midi_inputs); ClassDB::bind_method(D_METHOD("alert", "text", "title"), &OS::alert, DEFVAL("Alert!")); + ClassDB::bind_method(D_METHOD("crash", "message"), &OS::crash); ClassDB::bind_method(D_METHOD("set_low_processor_usage_mode", "enable"), &OS::set_low_processor_usage_mode); ClassDB::bind_method(D_METHOD("is_in_low_processor_usage_mode"), &OS::is_in_low_processor_usage_mode); |