godot icon indicating copy to clipboard operation
godot copied to clipboard

print_orphan_nodes() in Tool Crashes the Editor

Open CookieBadger opened this issue 2 years ago • 1 comments

Godot version

4.0beta15

System information

Windows10, AMD Ryzen 9 3900XT, RTX3070, Vulkan

Issue description

When you run print_orphan_nodes() in a Tool in the editor, the editor prints 133378869456 - Stray Node: @@17558 (Type: ProgressDialog), then freezes/crashes.

Steps to reproduce

  • Add the following script to a node:
@tool
extends Node


func _process(delta):
	if Input.is_action_just_pressed("ui_accept"):
		print_orphan_nodes()

reload the scene and then press space. The editor freezes and/or crashes.

Minimal reproduction project

TestEditorPluginInput.zip

CookieBadger avatar Jan 25 '23 00:01 CookieBadger

also occurs in beta 14

CookieBadger avatar Jan 25 '23 00:01 CookieBadger

Thanks!

CookieBadger avatar Mar 15 '23 22:03 CookieBadger

@YuriSizov just tried again in 4.0.3rc1 mono in C#, same issue happens and prints the same orphan (133815077082 - Stray Node: (Type: ProgressDialog)) here's a reproduction project: EditorPluginPrintOrphan.zip

CookieBadger avatar May 11 '23 01:05 CookieBadger

This fix was not cherry-picked or backported to 4.0.x. It's fixed in master, i.e. in the upcoming 4.1. Please check with the 4.1 dev1 or dev2.

YuriSizov avatar May 11 '23 15:05 YuriSizov

My bad, I checked and saw it works in dev2! Thanks. However, it is printing loads and loads of nodes: image

CookieBadger avatar May 12 '23 06:05 CookieBadger

@CookieBadger That's probably correct, because in editor there are many places where we have a hidden node removed from the tree completely and stored as a reference. As long as this is handled properly by the destructor method, it should be fine.

YuriSizov avatar May 13 '23 16:05 YuriSizov