Skip to content
This repository was archived by the owner on Dec 29, 2024. It is now read-only.
This repository was archived by the owner on Dec 29, 2024. It is now read-only.

Bug Report:Memory leak with passing lua functions to GDScript #155

Description

@radiantgurl

Describe the bug
This bug happens by creating constant references and not being able to know when the reference is removed or not.

To Reproduce

extends Node

func do_something_with_callable(callable: Callable):
	pass

# Called when the node enters the scene tree for the first time.
func _ready():
	var api = LuaAPI.new()
	api.push_variant("do_something_with_callable",do_something_with_callable)
	api.do_string("""
	while true do
		do_something_with_callable(function() end)
	end
	""")

Expected behavior
The memory usage should remain stable, not constantly rising.

Environment (please complete the following information):

  • OS: Linux 6.4.12-arch1-1
  • Godot version: v4.1.1.stable.official [bd6af8e0e]
  • Module version: v2.1-beta4

Additional context
Add any other context about the problem here.
image
Very quickly rising memory usages from 200 MB to 500MB within 5 seconds, potentially more if left longer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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