summaryrefslogtreecommitdiffstats
path: root/core/core_bind.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-12-06 16:34:15 +0100
committerGitHub <noreply@github.com>2021-12-06 16:34:15 +0100
commit3ae8eda1ed30b6c32f6fc1141118c5a062161a96 (patch)
treecd211aeac075967a5c6598cb06345962126008f5 /core/core_bind.cpp
parente8082003f19ad8d98b6b2f74f64f4eaa7fe86353 (diff)
parent5761b90f3c7d66f5a93aef57e6a21feb807d24bf (diff)
downloadredot-engine-3ae8eda1ed30b6c32f6fc1141118c5a062161a96.tar.gz
Merge pull request #55603 from Calinou/add-os-crash-method
Add an `OS.crash()` method for testing system crash handler
Diffstat (limited to 'core/core_bind.cpp')
-rw-r--r--core/core_bind.cpp5
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);