Make sure we await for the file writing to complete before reporting that compilation is done. (flutter/engine#4210)

This commit is contained in:
Alexander Aprelev
2017-10-12 13:39:19 -07:00
committed by GitHub
parent 4419ecfa91
commit dcdf709491

View File

@@ -176,8 +176,8 @@ class _FrontendCompiler implements CompilerInterface {
final IOSink sink = new File(_kernelBinaryFilename).openWrite();
final BinaryPrinter printer = printerFactory.newBinaryPrinter(sink);
printer.writeProgramFile(program);
_outputStream.writeln("$boundaryKey $_kernelBinaryFilename");
await sink.close();
_outputStream.writeln("$boundaryKey $_kernelBinaryFilename");
} else
_outputStream.writeln(boundaryKey);
return null;
@@ -191,8 +191,8 @@ class _FrontendCompiler implements CompilerInterface {
final IOSink sink = new File(_kernelBinaryFilename).openWrite();
final BinaryPrinter printer = printerFactory.newBinaryPrinter(sink);
printer.writeProgramFile(deltaProgram.newProgram);
_outputStream.writeln("$boundaryKey $_kernelBinaryFilename");
await sink.close();
_outputStream.writeln("$boundaryKey $_kernelBinaryFilename");
return null;
}