From a000c64eeaf8f50b76b61dcfd110fc78ff1df495 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 13 Feb 2023 20:39:17 +0200 Subject: Cleanup Window callbacks before destroying in to avoid callback calls with invalid object. --- scene/main/window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scene/main') diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 663dd586c0..9092be93e6 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -569,6 +569,12 @@ void Window::_update_from_window() { void Window::_clear_window() { ERR_FAIL_COND(window_id == DisplayServer::INVALID_WINDOW_ID); + DisplayServer::get_singleton()->window_set_rect_changed_callback(Callable(), window_id); + DisplayServer::get_singleton()->window_set_window_event_callback(Callable(), window_id); + DisplayServer::get_singleton()->window_set_input_event_callback(Callable(), window_id); + DisplayServer::get_singleton()->window_set_input_text_callback(Callable(), window_id); + DisplayServer::get_singleton()->window_set_drop_files_callback(Callable(), window_id); + if (transient_parent && transient_parent->window_id != DisplayServer::INVALID_WINDOW_ID) { DisplayServer::get_singleton()->window_set_transient(window_id, DisplayServer::INVALID_WINDOW_ID); } -- cgit v1.2.3