flush more frequently in PCE savestate memorywriter code

This commit is contained in:
zeromus 2014-04-08 00:22:42 +00:00
parent 3dc3ede00a
commit de89e38d7a
1 changed files with 2 additions and 1 deletions

View File

@ -418,12 +418,12 @@ namespace BizHawk.Emulation.Cores.PCEngine
byte[] stateBuffer;
public byte[] SaveStateBinary()
{
if (stateBuffer == null)
{
var stream = new MemoryStream();
var writer = new BinaryWriter(stream);
SaveStateBinary(writer);
writer.Flush();
stateBuffer = stream.ToArray();
writer.Close();
return stateBuffer;
@ -433,6 +433,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
var stream = new MemoryStream(stateBuffer);
var writer = new BinaryWriter(stream);
SaveStateBinary(writer);
writer.Flush();
writer.Close();
return stateBuffer;
}