Leak errors when closing build

Godot Version

4.3

Question

When closing the build version of my project (on Windows, which is the OS I’m editing it on), the following errors appear in the Command line:

ERROR: 1 RID allocations of type 'N10RendererRD14TextureStorage7TextureE' were leaked at exit.
ERROR: Parameter "RenderingServer::get_singleton()" is null.
   at: ~CompressedTexture2D (scene/resources/compressed_texture.cpp:464)
WARNING: 2 RIDs of type "Texture" were leaked.
     at: finalize (servers/rendering/rendering_device.cpp:5758)

The errors have been there for quite some time now, so I don’t know after what change they appeared. The builds of any other project work fine and there are no errors when running from the editor. Do you know why they appear in the build or how I can fix them?

“build version” you meant not exported?
@tool scripts may produce similar error. Some resource reference kept by editor.

With build version I meant the project exported to an exe, sorry for the unclarity.

I have no @tool scripts in the project, and no plugins installed…

(When I run an export of the game with all the process functions removed and without a main menu, the errors don’t appear, so I think it can’t be directly because of the GUI scene or the program opening files)

I finally figured out what the problem was!
For some reason, whenever I set a custom mouse cursor (in any project), these leak errors appear in the exported executable.
I got rid of them by keeping the custom cursor but setting the mouse cursor to null when the program is closed (in my case, when a base node exits the tree).

func _exit_tree() -> void:
	Input.set_custom_mouse_cursor(null)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.