Merge "Stops the loop when all files are closed."
am: d8d7fc6717

Change-Id: If42cde1e5e4026915e5bc2e773ac6ff46aa9a8d9