Delete struct on input end