From 621b9a1bfe9660717f792945595ebfb3cd3ca305 Mon Sep 17 00:00:00 2001 From: Rindbee Date: Fri, 2 Sep 2022 10:30:08 +0800 Subject: [PATCH] Fix getting an error message when repeatedly entering and exiting the tree --- scene/main/canvas_item.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 61a7600664d..65e7ba3e674 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -338,6 +338,7 @@ void CanvasItem::_notification(int p_what) { } if (window) { window->disconnect(SceneStringNames::get_singleton()->visibility_changed, callable_mp(this, &CanvasItem::_window_visibility_changed)); + window = nullptr; } global_invalid = true; parent_visible_in_tree = false;