-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lots of Unreferenced static string to 0:
errors when closing a scene
#20
Comments
Some information I got:
Correction: C# exception has nothing to do with |
@takethebait can you try #21? |
@scgm0 tested the changes but unfortunately the error persists at least on my end and the behaviour has not changed. |
Same here, found it just delayed the problem, waiting for Raul. . . |
I went ahead and tried to debug the disposable tracking (do note that I'm not very familiar with the code yet): I'm noticing that a weak reference is registered for every _process and _physics_process as well as all the other events. Won't this result in something like an OutOfMemoryException at some point since instances only seem to be deregistered on shutdown? The My log looks something like this during the registration: and like this during deregistration: Edit: Edit 2: The constant registration happens in CallVirtualMethod_Native I don't know if this is of any help but I found this interesting. |
Unreferenced static string to 0:
errors when closing a sceneUnreferenced static string to 0:
errors when closing a scene
Thanks to you both for looking into this issue. Correct me if I'm wrong but it looks like this issue only happens with the
Maybe we should not be taking ownership of those |
I'm not 100% that its only virtual methods as every time I close down the editor while having a project with a NET GDExtension loaded I also get an error for the string Haven't looked into that one yet though, I'll try to see where it comes from. |
Godot version
Godot v4.4.dev (7c383767a)
Godot .NET packages version
master (9cb7bec)
System information
Godot v4.4.dev (7c383767a) - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 32.0.15.6094) - AMD Ryzen 9 3900X 12-Core Processor (24 Threads)
.NET information
.NET SDK: Version: 8.0.400 Commit: 36fe6dda56 Workload version: 8.0.400-manifests.56cd0383 MSBuild version: 17.11.3+0c8610977
Issue description
When closing a project which has an instance of a class, that's defined in a C# GDExtension, a lot of
ERROR: BUG: Unreferenced static string to 0: {_process | _enter_tree | _ready | _input | ...}
messages are printed in betweenDisposing tracked instances
andFinished disposing tracked instances
to the console. When explicitly overriding these methods in GDScript they will no longer be included in that list.Steps to reproduce
When running the scene from the editor, error message are only printed sporadically, sometimes there are none at all and everything seems to work just fine. Exporting the project however should print these errors every time you close the scene.
You can also notice that the amount of error messages become fewer the more methods you override in GDScript. When overriding _ready, _process, _physics_process, _enter_tree, _exit_tree, _unhandled_input, _input, _shortcut_input and _unhhandled_key_input no error messages should remain.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: