Skip to content

Lots of Unreferenced static string to 0: errors when closing a scene #20

Description

@takethebait

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 between Disposing tracked instances and Finished 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

  1. Declare a basic class on the C# side:
[GodotClass]
public partial class SampleNode : Node3D
{

}
  1. Register that class as a runtime class in the ClassDB
  2. Create a node of the type created in step 1 in a scene and attach an empty script written in GDScript that extends this type to it.
  3. Either run the scene and exit it from the editor or export the scene and run the exported version.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions