Editor's Bug or My Code Error?

Godot Version 4.5.1

Replace this line with your Godot version

Question

Ask your question here! Try to give as many details as possible

Started Godot editor with command : ./Godot_editor –verbose in Linux Fedora .

When closing the editor without first closing Player scene tab, the following error appeared on terminal console, after the editor completely shut down.

But if closing the Player scene before shutting down the editor the error doesn’t appear.

My question is - is this caused by my code in Player scene or it is a editor bug?

EditorSettings: Save OK!
XR: Clearing primary interface
XR: Removed interface "Native mobile"
XR: Removed interface "OpenXR"
PulseAudio: context terminated
WARNING: 13 RIDs of type "CanvasItem" were leaked.
     at: _free_rids (servers/rendering/renderer_canvas_cull.cpp:2678)
ERROR: 1 RID allocations of type 'N5GLES37TextureE' were leaked at exit.
ERROR: Texture with GL ID of 593: leaked 111676 bytes.
   at: ~Utilities (drivers/gles3/storage/utilities.cpp:77)
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: cleanup (core/object/object.cpp:2514)
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6713906382744 - Node path:
Leaked instance: CompressedTexture2D:9223374588736526789 - Resource path: res://assets/hopping/player/back/walk/1.png
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6826481509885 - Node path:
Leaked instance: Object:6826498287102
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6840675034649 - Node path:
Leaked instance: Object:6840691811870
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6703588545925 - Node path:
Leaked instance: Object:6735029048711
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6589637694859 - Node path:
Leaked instance: Object:6703605323156
Leaked instance: Object:6589654472085
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6723234665878 - Node path:
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6742545244868 - Node path:
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6686157021893 - Node path:
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6735012274887 - Node path:
Leaked instance: Object:6675050504906
Leaked instance: Object:6686173799115
Leaked instance: Object:6750782857933
Leaked instance: Object:6742562022094
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6675033727695 - Node path:
Leaked instance: Object:6713923314384
Leaked instance: Object:6723251446481
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6781334168274 - Node path:
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6750766080724 - Node path:
Leaked instance: Object:6757862843093
ERROR: Cannot get path of node as it is not in a scene tree.
   at: get_path (scene/main/node.cpp:2374)
Leaked instance: Control:6757846065878 - Node path:
Leaked instance: Object:6781350945500
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).
ERROR: 1 resources still in use at exit.
   at: clear (core/io/resource.cpp:790)
Resource still in use: res://assets/hopping/player/back/walk/1.png (CompressedTexture2D)
1 Like

In my experience orphan node errors like what you are showing are sometimes not printed out by the editor, despite still having orphan nodes.
Try running it and shutting it down multiple times without closing the Player scene tab to see if it does eventually print out those orphan nodes.
If so you are going to have to trace back to where the nodes are being lost.
In my experience the culprit will be instantiations using Class.new() that are not manually removed from memory.

There is also print_orphan_nodes() which can help you narrow down the point at which nodes are being orphaned.

the following is another with the player tab on when closing the editor.

what is the cause of Orphan StringName and how to fix them?

EditorSettings: Save OK!
XR: Clearing primary interface
XR: Removed interface “Native mobile”
XR: Removed interface “OpenXR”
PulseAudio: context terminated
ERROR: 2 RID allocations of type ‘N5GLES37TextureE’ were leaked at exit.
ERROR: Texture with GL ID of 593: leaked 111676 bytes.
at: ~Utilities (drivers/gles3/storage/utilities.cpp:77)
ERROR: Texture with GL ID of 596: leaked 117876 bytes.
at: ~Utilities (drivers/gles3/storage/utilities.cpp:77)
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
at: cleanup (core/object/object.cpp:2514)
Leaked instance: CompressedTexture2D:9223374588132546999 - Resource path: res://assets/hopping/player/back/walk/1.png
Leaked instance: CompressedTexture2D:9223374589424392655 - Resource path: res://assets/hopping/player/down/idle/2.png
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with remove_child()) but not freed (with free() or queue_free()).
ERROR: 2 resources still in use at exit.
at: clear (core/io/resource.cpp:790)
Resource still in use: res://assets/hopping/player/back/walk/1.png (CompressedTexture2D)
Resource still in use: res://assets/hopping/player/down/idle/2.png (CompressedTexture2D)
Orphan StringName: CollectionContainer (static: 0, total: 6)
Orphan StringName: speed_scale (static: 0, total: 6)
Orphan StringName: WinMessage (static: 0, total: 2)
Orphan StringName: ../ChallengeLevelUp/PanelContainer (static: 0, total: 1)
Orphan StringName: LifeContainer (static: 0, total: 8)
Orphan StringName: Wheel (static: 0, total: 1)
Orphan StringName: SingleLitRow (static: 0, total: 2)
Orphan StringName: ChallengeLevelUp (static: 0, total: 2)
Orphan StringName: World (static: 0, total: 1)
Orphan StringName: Label (static: 16, total: 17)
Orphan StringName: QmarkContainer (static: 0, total: 9)
Orphan StringName: CollectionContainer/RightCollection (static: 0, total: 3)
Orphan StringName: MarginContainer/VBoxContainer/Wheel (static: 0, total: 1)
Orphan StringName: GameWon (static: 0, total: 3)
Orphan StringName: ../../RiskRewardContainer/VBoxContainer/MarginContainer (static: 0, total: 1)
Orphan StringName: ../../QmarkContainer (static: 0, total: 1)
Orphan StringName: key-cover1 (static: 0, total: 2)
Orphan StringName: key-cover2 (static: 0, total: 2)
Orphan StringName: key-cover3 (static: 0, total: 2)
Orphan StringName: key-cover4 (static: 0, total: 2)
Orphan StringName: key-cover5 (static: 0, total: 2)
Orphan StringName: RiskRewardContainer (static: 0, total: 4)
Orphan StringName: Motorcycle2 (static: 0, total: 6)
Orphan StringName: RightCollection (static: 0, total: 3)
Orphan StringName: ../../QmarkContainer/Jump (static: 0, total: 2)
Orphan StringName: modulate (static: 0, total: 45)
Orphan StringName: ../World/Player (static: 0, total: 1)
Orphan StringName: ../../PlatformLayer/Clock/ClockAlertContainer (static: 0, total: 3)
Orphan StringName: texture (static: 0, total: 6)
Orphan StringName: ColorRect (static: 1, total: 3)
Orphan StringName: ../../QmarkContainer/DoubleLitRow (static: 0, total: 2)
Orphan StringName: ../MissionFailed/PanelContainer (static: 0, total: 1)
Orphan StringName: ZeroLife (static: 0, total: 4)
Orphan StringName: LabelContainer (static: 0, total: 1)
Orphan StringName: Player (static: 0, total: 7)
Orphan StringName: emitting (static: 0, total: 12)


StringName: 103 unclaimed string names at exit.

It is impossible to say where the problem is without seeing your code, however it looks like there is going to be a lot of code.
So instead I will give an example of how nodes can be orphaned.

func _ready() -> void:
	print("---")
	print_orphan_nodes()    # this will print nothing because there are no orphan nodes yet
	print("---")
	var test = Node.new()   # we create a node in memory
	print_orphan_nodes()    # this will print that node because it remains in memory at this point
	print("---")
	test.free()	            # we free the node from memory
	print_orphan_nodes()    # this again prints nothing because the node was freed and there are none left in memory
	print("---")

The output from the above code:

---
---
39611008479 - Stray Node:  (Type: Node) (Source:)
---
---

In my experience orphaned nodes show up as leaked RID’s on halting execution of the code.
So the way to debug your leaked RID’s is to look for orphaned nodes primarily pertaining to the creation of class instances using the .new() method.

It is still possible that there is something else causing your RID leaks but this list of errors looks very much like what I see with orphaned nodes.