summaryrefslogtreecommitdiffstats
path: root/core/debugger/engine_debugger.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/debugger/engine_debugger.h')
-rw-r--r--core/debugger/engine_debugger.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/debugger/engine_debugger.h b/core/debugger/engine_debugger.h
index 1bae71e37a..88d5490794 100644
--- a/core/debugger/engine_debugger.h
+++ b/core/debugger/engine_debugger.h
@@ -126,7 +126,13 @@ public:
void profiler_enable(const StringName &p_name, bool p_enabled, const Array &p_opts = Array());
Error capture_parse(const StringName &p_name, const String &p_msg, const Array &p_args, bool &r_captured);
- void line_poll();
+ void line_poll() {
+ // The purpose of this is just processing events every now and then when the script might get too busy otherwise bugs like infinite loops can't be caught.
+ if (unlikely(poll_every % 2048) == 0) {
+ poll_events(false);
+ }
+ poll_every++;
+ }
virtual void poll_events(bool p_is_idle) {}
virtual void send_message(const String &p_msg, const Array &p_data) = 0;