Tastudio - LoadState() - properly dispose of IDisposables, avoid unnecessary .ToArray() call
This commit is contained in:
parent
7ac720d931
commit
f944cd65a7
|
@ -909,7 +909,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public void LoadState(KeyValuePair<int, byte[]> state)
|
||||
{
|
||||
StatableEmulator.LoadStateBinary(new BinaryReader(new MemoryStream(state.Value.ToArray())));
|
||||
using var ms = new MemoryStream(state.Value);
|
||||
using var br = new BinaryReader(ms);
|
||||
StatableEmulator.LoadStateBinary(br);
|
||||
|
||||
if (state.Key == 0 && CurrentTasMovie.StartsFromSavestate)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue