Rapid creation and destruction of voxel volumes causes crash

@John, @Simeon, Rapidly creating and destroying voxel volumes crashes Codea on my iPhone 8.

Example code is below, also included as a project in attachment.

Slide the slider back and forth quickly to cause a crash.


function setup()    
    scene = craft.scene()    
    parameter.integer("resetter", 1, 8, 1, function()   
        clear()
        generate()
    end)
    generate()
end

function clear()
    if volumes then
        for _, entity in pairs(volumes.entities) do
            entity:destroy()
        end 
        volumes = nil
    end
end

function generate()
    volumes = {}
    volumes.entities = {}
    for i=1, 4 do
        local newEntity = scene:entity()
        local newVolume = newEntity:add(craft.volume)
        newVolume:resize(256, 128, 256)
        table.insert(volumes, newVolume) 
        table.insert(volumes.entities, newEntity)       
    end
end    

function draw()
    scene:update(DeltaTime)
    scene:draw() 
end