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
Closed
Description
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.
Very quickly rising memory usages from 200 MB to 500MB within 5 seconds, potentially more if left longer.