Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit 2b065fc

Browse files
committed
[[ Bug 22839 ]] Clear focused control ref from card when relayering
This patch ensures there are no lingering keyboard or mouse focus control references after relayering a control from card to group owner.
1 parent 49808f6 commit 2b065fc

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

docs/notes/bugfix-22839.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix crash when relayering focused control into group

engine/src/card.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,9 @@ void MCCard::relayercontrol_remove(MCControl *p_control)
16461646

16471647
// Remove the control from the card's objptr list.
16481648
t_control_ptr -> remove(objptrs);
1649+
// make sure this card no longer points to the removed control
1650+
clearfocus(t_control_ptr, nullptr);
1651+
16491652
delete t_control_ptr;
16501653

16511654
// Remove the control from the stack's list.

0 commit comments

Comments
 (0)