Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/input/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down
3 changes: 3 additions & 0 deletions core/input/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ class Input : public Object {
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);
Expand Down
6 changes: 6 additions & 0 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Loading