Clean Input::frame_parsed_events before de-initialising scripting languages to ensure no script created events exist at the exit.

This commit is contained in:
bruvzg 2024-05-20 11:20:00 +03:00
parent 60844997bb
commit 2c9df769ad
No known key found for this signature in database
GPG Key ID: 7960FCF39844EC38
3 changed files with 17 additions and 0 deletions

View File

@ -1029,6 +1029,14 @@ void Input::parse_input_event(const Ref<InputEvent> &p_event) {
}
}
#ifdef DEBUG_ENABLED
void Input::flush_frame_parsed_events() {
_THREAD_SAFE_METHOD_
frame_parsed_events.clear();
}
#endif
void Input::flush_buffered_events() {
_THREAD_SAFE_METHOD_

View File

@ -363,6 +363,9 @@ public:
Dictionary get_joy_info(int p_device) const;
void set_fallback_mapping(const String &p_guid);
#ifdef DEBUG_ENABLED
void flush_frame_parsed_events();
#endif
void flush_buffered_events();
bool is_using_input_buffering();
void set_use_input_buffering(bool p_enable);

View File

@ -4182,6 +4182,12 @@ void Main::cleanup(bool p_force) {
ERR_FAIL_COND(!_start_success);
}
#ifdef DEBUG_ENABLED
if (input) {
input->flush_frame_parsed_events();
}
#endif
for (int i = 0; i < TextServerManager::get_singleton()->get_interface_count(); i++) {
TextServerManager::get_singleton()->get_interface(i)->cleanup();
}