I would like to know if the following is a bug and whether it is already known.
create a collection
the collection create a go with a script
the script has something like the following
if message_id == hash(“jump_”) then
go.animate(id, “position.x”, go.PLAYBACK_ONCE_FORWARD, x, go.EASING_LINEAR, 0.5, 0.0,
function() msg.post(".", “jump_”, {index = i}) end)
end
destroy the collection
GOTO 1.
In each cycle the Lua Refs count increases by 1. If I remove the msg.post function inside the go.animate the Lua Refs does NOT increase and everything is fine.
As far as I understand this is not the same problem. They are both related to lua refs and go.animate with a function starting again the animation at the end of the animation… (it seems I am lucky with these functions!)
The actual problem does NOT increase lua refs count until I destroy the collection containing it. Instead the old one increases the lua refs count each time the animation is performed.
I am somehow worried by this problem since I use the same structure in many many places in the game.
At the moment my game is structured in “rooms”. Each time I destroy the old room and create a new room I see the Lua Refs Count increases by 10-20 units. And also the total lua memory and the total memory increases.
In order to debug this I have step by step simplified the code and it seems to me that I have found something that is clearly wrong in the fragment I described in my first post.
I have struggled to make a small repro example, but till now I have failed. I see the error in the game (commenting out the msg.post line prevents any lua refs loss) but I cannot reproduce it… However I will keep trying.