Fix possible crash with an invalid last_mouse_focus pointer
This commit is contained in:
parent
89eb79aef1
commit
761caac0b2
1 changed files with 3 additions and 0 deletions
|
@ -2496,6 +2496,9 @@ void Viewport::_gui_remove_control(Control *p_control) {
|
||||||
gui.mouse_focus = NULL;
|
gui.mouse_focus = NULL;
|
||||||
gui.mouse_focus_mask = 0;
|
gui.mouse_focus_mask = 0;
|
||||||
}
|
}
|
||||||
|
if (gui.last_mouse_focus == p_control) {
|
||||||
|
gui.last_mouse_focus = NULL;
|
||||||
|
}
|
||||||
if (gui.key_focus == p_control)
|
if (gui.key_focus == p_control)
|
||||||
gui.key_focus = NULL;
|
gui.key_focus = NULL;
|
||||||
if (gui.mouse_over == p_control)
|
if (gui.mouse_over == p_control)
|
||||||
|
|
Loading…
Reference in a new issue