From 21e4636eecba020f1ddc9e7a8c8477e20a0bfc9f Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:32:30 +0200 Subject: [PATCH] fix missing dispose in LoadSaveRam fixes 291dd80c27a7924666ae7800d81f91c4b90dba08 --- src/BizHawk.Client.EmuHawk/MainForm.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 6266e47901..2d617dfaff 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -2059,7 +2059,8 @@ namespace BizHawk.Client.EmuHawk // why do we silently truncate\pad here instead of warning\erroring? sram = new byte[oldRam.Length]; - _ = saveramToLoad.OpenRead().Read(sram, 0, sram.Length); + using var fs = saveramToLoad.OpenRead(); + _ = fs.Read(sram, 0, sram.Length); } Emulator.AsSaveRam().StoreSaveRam(sram);