Skip to content
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

Orphan StringName: SceneMultiplayer #64591

Closed
neikeq opened this issue Aug 19, 2022 · 0 comments · Fixed by #74031
Closed

Orphan StringName: SceneMultiplayer #64591

neikeq opened this issue Aug 19, 2022 · 0 comments · Fixed by #74031
Assignees
Milestone

Comments

@neikeq
Copy link
Contributor

neikeq commented Aug 19, 2022

Godot version

4.0.dev (c2eaaef)

System information

Ubuntu 22.04

Issue description

The "SceneMultiplier" StringName is left orphaned because it's assigned to a static field here:

StringName MultiplayerAPI::default_interface = StringName();
void MultiplayerAPI::set_default_interface(const StringName &p_interface) {
ERR_FAIL_COND_MSG(!ClassDB::is_parent_class(p_interface, MultiplayerAPI::get_class_static()), vformat("Can't make %s the default multiplayer interface since it does not extend MultiplayerAPI.", p_interface));
default_interface = p_interface;
}

That method is called from:

MultiplayerAPI::set_default_interface("SceneMultiplayer");

One solution is to free the StringName from some sort of cleanup method. The other solution is to create the StringName as static:

-default_interface = p_interface;
+default_interface = StringName(p_interface, true);

Steps to reproduce

  • Run Godot in verbose mode -v/--verbose.
  • Close Godot and you'll see this message printed in the terminal:
    Orphan StringName: SceneMultiplayer
    StringName: 1 unclaimed string names at exit.
    

Minimal reproduction project

This should be reproducible on all projects. It's also reproducible with the project manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants