Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Enforces correct creation and destruction order for Filament engine objects, entities, components, and GPU buffers in C++ rendering code.
86% 100%+14 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 19 of 22 without it.
When completely tearing down an entity that has renderable and transform components attached in Filament, does calling engine->getEntityManager().destroy(entity) first automatically clean up the components, or is a specific sequence required?
Specifies calling engine->destroy(entity) prior to calling engine->getEntityManager().destroy(entity).
3 of 3 safety checks passed
Filament manages its own native allocations. To prevent segmentation faults and memory leaks, follow these rules:
EntityManager directly from the Engine instance:
utils::EntityManager& em = engine->getEntityManager();Engine pointer is inaccessible:
utils::EntityManager& em = utils::EntityManager::get();utils::Entity entity = engine->getEntityManager().create();engine->getEntityManager().destroy(entity);RenderableManager::Builder or LightManager::Builder on the entity:
RenderableManager::Builder(1)
.geometry(0, RenderableManager::PrimitiveType::TRIANGLES, vb, ib)
.material(0, matInstance)
.build(*engine, entity);
Camera* camera = engine->createCamera(entity);engine->destroy(entity);
Second, free the Entity ID:
engine->getEntityManager().destroy(entity);
// Correct Entity Cleanup
engine->destroy(myEntity);
engine->getEntityManager().destroy(myEntity);
Next to this one in the catalogue, plus more from the same author.