浏览代码

Fix getting an error message when repeatedly entering and exiting the tree

Rindbee 3 年之前
父节点
当前提交
621b9a1bfe
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      scene/main/canvas_item.cpp

+ 1 - 0
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;