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

Fix activate_item_by_event infinite recursion crash #84183

Merged

Conversation

jsjtxietian
Copy link
Contributor

Fixes #84176

The crash cames from activate_item_by_event will call itself on it's submenu item found by name, but if the submenu's name is ., it will enter infinite resursion.

I chose to prevent it happen from add_submenu_item, but there might be other ways I wasn't aware of. Feel free to correct me.

@jsjtxietian jsjtxietian requested a review from a team as a code owner October 30, 2023 11:22
@YuriSizov YuriSizov added this to the 4.2 milestone Oct 30, 2023
scene/gui/popup_menu.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

scene/gui/popup_menu.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than one small change, this is good.

@jsjtxietian jsjtxietian force-pushed the fix-activate_item_by_event-crash branch from b7eefbe to 137b25c Compare November 1, 2023 02:30
@akien-mga akien-mga merged commit cfbccdb into godotengine:master Nov 1, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executing PopupMenu.activate_item_by_event function crashes Godot
3 participants