Destroy the object and close the file.
Also remove the file for FileMode::Temporary.
FileMode::Temporary