ENG-6358: make sure generation is closed and deleted.