summaryrefslogtreecommitdiff
path: root/scene/main/viewport.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-02-15 09:27:32 +0100
committerGitHub <noreply@github.com>2019-02-15 09:27:32 +0100
commit3f74a54cd498a7857557bdca6b034b0b38f662b0 (patch)
tree3c6a0192d9e6ece63c25db1be8ecabf5a4d2a6c4 /scene/main/viewport.cpp
parente7e4d41a29044be753d1ab1574e131b02c9df007 (diff)
parent761caac0b24062f76d875c72722c1d07b64fb4ad (diff)
Merge pull request #25894 from marcelofg55/last_mouse_focus_crash
Fix possible crash with an invalid last_mouse_focus pointer
Diffstat (limited to 'scene/main/viewport.cpp')
-rw-r--r--scene/main/viewport.cpp3
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)