summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2023-02-13 20:24:29 +0100
committerGitHub <noreply@github.com>2023-02-13 20:24:29 +0100
commit854d9c3d9c77270ff3260a8edcc12fccc85514c1 (patch)
tree37ed46221686888a76ba2b7e0921c4f6af4cdf81 /scene/main
parent381590311958ab00251639af6d7efc6934dd3c72 (diff)
parenta000c64eeaf8f50b76b61dcfd110fc78ff1df495 (diff)
Merge pull request #73239 from bruvzg/cleanup_callback
Cleanup Window callbacks before destroying in to avoid callback calls with invalid object.
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/window.cpp6
1 files changed, 6 insertions, 0 deletions
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);
}