Fix bug with destroyComponent in a component's destroy method