diff --git a/zecsy.hpp b/zecsy.hpp index f5f388a..34f5216 100644 --- a/zecsy.hpp +++ b/zecsy.hpp @@ -141,6 +141,13 @@ namespace zecsy auto& pool = pools[id]; auto index = pool.entity_to_index[e]; + + /* + * T may be non-POD, so I guess I should call a destructor here + */ + auto comp_ptr = reinterpret_cast(&pool.data[index * sizeof(T)]); + comp_ptr->~T(); + pool.free_list.push_back(index); pool.entity_to_index.erase(e); pool.index_to_entity.erase(index);