diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2019-10-22 16:28:11 +0200 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2019-10-22 16:28:11 +0200 |
commit | e3d4b96ba748c3945d66d018531bb6de86a9c622 (patch) | |
tree | c860c35667d7fcc10e883c8854cf80e8ed65b600 /scene/gui | |
parent | 1be39232b4294f1a1f253426978ab8ed2954b05a (diff) |
Fixed crashes when renaming a state in AnimationNodeStateMachineEditor
Recursive calls to Control::_modal_stack_remove could cause a crash because of the list element not being invalidated while being erased from the list.
It happens in the state machine case by hiding a line edit control when it loses focus.
Fixes #23808
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/control.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index fafbcf0c55..8b4d5d4980 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2221,9 +2221,11 @@ void Control::_modal_stack_remove() { if (!data.MI) return; - get_viewport()->_gui_remove_from_modal_stack(data.MI, data.modal_prev_focus_owner); - + List<Control *>::Element *element = data.MI; data.MI = NULL; + + get_viewport()->_gui_remove_from_modal_stack(element, data.modal_prev_focus_owner); + data.modal_prev_focus_owner = 0; } |