Change to flush and close logic to fix #1760556.
1 file changed