diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-11-27 16:01:30 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-11-27 16:01:30 +0100 |
commit | a807d4bfa79f7308ad87d78002269a05b0a4841b (patch) | |
tree | 4db64ce027a2dede4ebc7497a5246c7a95370bdd | |
parent | b20ecc91e4112a6f5918dc98045bbe9e56d7399d (diff) | |
parent | bf19ced15d7c6ff1ffd33068a739020b65eefb18 (diff) | |
download | redot-engine-a807d4bfa79f7308ad87d78002269a05b0a4841b.tar.gz |
Merge pull request #85418 from bruvzg/fix_crash_on_late_enterexit
Fix crash on late mouse enter/exit event arrival.
-rw-r--r-- | scene/main/window.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 2c28dc31d6..823b0c6f5b 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -681,6 +681,9 @@ void Window::_propagate_window_notification(Node *p_node, int p_notification) { void Window::_event_callback(DisplayServer::WindowEvent p_event) { switch (p_event) { case DisplayServer::WINDOW_EVENT_MOUSE_ENTER: { + if (!is_inside_tree()) { + return; + } Window *root = get_tree()->get_root(); if (root->gui.windowmanager_window_over) { #ifdef DEV_ENABLED @@ -696,6 +699,9 @@ void Window::_event_callback(DisplayServer::WindowEvent p_event) { } } break; case DisplayServer::WINDOW_EVENT_MOUSE_EXIT: { + if (!is_inside_tree()) { + return; + } Window *root = get_tree()->get_root(); if (!root->gui.windowmanager_window_over) { #ifdef DEV_ENABLED |