Skip to content

Comments

Fix crash on removing Windows PopupMenu submenu#115373

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
kitbdev:fix-windows-submenu-remove-crash
Jan 26, 2026
Merged

Fix crash on removing Windows PopupMenu submenu#115373
Repiteo merged 1 commit intogodotengine:masterfrom
kitbdev:fix-windows-submenu-remove-crash

Conversation

@kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Jan 25, 2026

When freeing a node that has a native Windows PopupMenu with a submenu, it crashes.
This happens since 4.3 as far as I can tell.

Reproduction example script:

func _ready() -> void:
	var submenu := PopupMenu.new()
	submenu.add_item("b")
	var menu := PopupMenu.new()
	menu.prefer_native_menu = true
	menu.add_submenu_node_item("a", submenu)
	add_child(menu)
	queue_free() # also happens on exit without this line

p_submenu_rid does not need to be valid, so I put the code that uses it into the if statement.

@kitbdev kitbdev added this to the 4.7 milestone Jan 25, 2026
@kitbdev kitbdev requested a review from a team as a code owner January 25, 2026 20:01
@kitbdev kitbdev added bug crash topic:gui cherrypick:4.6 Considered for cherry-picking into a future 4.6.x release platform:windows labels Jan 25, 2026
@bruvzg bruvzg self-requested a review January 25, 2026 20:11
@Repiteo Repiteo merged commit d40dd57 into godotengine:master Jan 26, 2026
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jan 26, 2026

Thanks!

@kitbdev kitbdev deleted the fix-windows-submenu-remove-crash branch January 26, 2026 22:43
rivie13 pushed a commit to rivie13/Phoenix-Agentic-Engine that referenced this pull request Feb 16, 2026
…u-remove-crash

Fix crash on removing Windows PopupMenu submenu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug cherrypick:4.6 Considered for cherry-picking into a future 4.6.x release crash platform:windows topic:gui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants