flush more frequently in PCE savestate memorywriter code
This commit is contained in:
parent
3dc3ede00a
commit
de89e38d7a
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue