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

Leaked instances and Orphan StringNames on exiting game on android device when using plugins #91739

Closed
quanixstudio opened this issue May 9, 2024 · 2 comments · Fixed by #92143

Comments

@quanixstudio
Copy link

quanixstudio commented May 9, 2024

Tested versions

4.2.1 stable
4.2.2 stable
4.3-dev6

System information

Windows 11 - Godot v4.2.2.stable - Forward+

Issue description

When running a project on an android device, on exiting it shows a leaked instance for every plugin loaded with Orphan StringNames of all the methods from the plugin that uses @UsedByGodot after calling get_tree().quit().

-- My project
Schermafbeelding 2024-05-09 000634

-- MRP --
Schermafbeelding 2024-05-09 023119

Steps to reproduce

Create a new project.
Add an android plugin.
Run project on a physical android device and monitor logcat on exiting.

Minimal reproduction project (MRP)

TestProject.zip

@akien-mga
Copy link
Member

CC @m4gr3d

@quanixstudio
Copy link
Author

When storing the plugin singleton into a variable and on _exit_tree() calling free() on that variable, the leaked instance and Orphan StringNames are gone.

var plugin : Object

func _ready() -> void:
	if Engine.has_singleton("pluginname"):
		plugin = Engine.get_singleton("pluginname")

func _exit_tree() -> void:
	if plugin != null:
		plugin.free()

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.

3 participants