Hello! First of all thank you so much for this wonderful library!
I have a question regarding the creation and destruction of vents.
Suppose I have a simple physics game with a crate. Everytime the crate collides with the floor I want to have an explosion on the collision location. Is the correct way to do this, to create a new vent on each collision with the desired effect, on that collisions location? If so, suppose the following implementation:
local function createExplosion(x, y) local vent = CBE.newVent { preset = "burn", x=x, y=y } local function destroyVent() vent:stop() vent = nil end vent:start() timer.performWithDelay(1000, destroyVent) end createExplosion(150,150)
Will this correctly destroy the created vents so that they can be garbage collected?
I noticed that if you don’t stop a vent it keeps on working even if you lost all references to it (memory leak).