diff options
author | Marcelo Fernandez <marcelofg55@gmail.com> | 2019-02-14 22:16:56 -0300 |
---|---|---|
committer | Marcelo Fernandez <marcelofg55@gmail.com> | 2019-02-14 22:16:56 -0300 |
commit | 761caac0b24062f76d875c72722c1d07b64fb4ad (patch) | |
tree | e41f02eed7a283b29af04672694b254f80d34aa6 | |
parent | 89eb79aef1aac645358664a8245afe35b30da130 (diff) |
Fix possible crash with an invalid last_mouse_focus pointer
-rw-r--r-- | scene/main/viewport.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index cad29f13bf..f7df29fd19 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2496,6 +2496,9 @@ void Viewport::_gui_remove_control(Control *p_control) { gui.mouse_focus = NULL; gui.mouse_focus_mask = 0; } + if (gui.last_mouse_focus == p_control) { + gui.last_mouse_focus = NULL; + } if (gui.key_focus == p_control) gui.key_focus = NULL; if (gui.mouse_over == p_control) |