diff --git a/tools/io.h b/tools/io.h index 8bbee3a0df..a48e3c325e 100644 --- a/tools/io.h +++ b/tools/io.h @@ -144,6 +144,7 @@ class OutputFile { ~OutputFile() { if (fp_ == stdout) { + fflush(stdout); SET_STDOUT_MODE(old_mode_); } else if (fp_ != nullptr) { fclose(fp_);