Closed Bashar-Ahmed closed 1 year ago
onRemove()
doesn't seem to be the proper place to make this change. Calling a destructor manually should be done at the site where a placement new operator was used.
You should be able to call the destructor directly instead of relaying it through Component::onRemove()
. The onRemove()
function is executed when the component is detached from an entity. It has nothing to do with resource de-allocation.
Fixes #593