Merge pull request #25894 from marcelofg55/last_mouse_focus_crash

Fix possible crash with an invalid last_mouse_focus pointer
This commit is contained in:
Rémi Verschelde 2019-02-15 09:27:32 +01:00 committed by GitHub
commit 3f74a54cd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)