Open einarnordengren opened 6 months ago
If you set nil, Listener should be destroyed
I look at code. It looks like listeners removed when world is destroyed.
Right, so it should work by just destroying the world. However, if I add
self.world:SetContactListener({
BeginContact = function() end,
EndContact = function() end,
PreSolve = function() end,
PostSolve = function() end
})
in the init function of the dominos_scene.script, the number LuaRefs increases (checked in the web profiler) every time I press restart even if the world is destroyed in final.
Is there any way to destroy contact listeners or destruction listeners? It looks like the references to them are destroyed in the world's Destroy() function, but the number of LuaRefs keeps increasing every time I reinitalize the world.