diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-10-22 19:43:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-22 19:43:36 +0200 |
commit | aafd5dd5c1bce070d87e3dc0a19b81ce2cafe9ec (patch) | |
tree | fb3127bf32e4fa3b2ba192c194dbaff6b102644f | |
parent | 365558b8b7aed930c219044176c886eaaf8d752d (diff) | |
parent | e3d4b96ba748c3945d66d018531bb6de86a9c622 (diff) |
Merge pull request #32989 from nekomatata/fix-crash-rename-state
Fixed crashes when renaming a state in AnimationNodeStateMachineEditor
-rw-r--r-- | scene/gui/control.cpp | 6 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 1 |
2 files changed, 4 insertions, 3 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; } diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 52ef225364..95536bbb23 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2374,7 +2374,6 @@ void Viewport::_gui_remove_from_modal_stack(List<Control *>::Element *MI, Object List<Control *>::Element *next = MI->next(); gui.modal_stack.erase(MI); - MI = NULL; if (p_prev_focus_owner) { |