Frees memory by closing the lab files after analyzing.