From 1d87bcd29c946be333a3b33e48ac0ae520497ea2 Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 14 Aug 2020 08:12:44 -0400 Subject: [PATCH] Dispose MemoryBlock in zwinderbuffer (fixes #2304) --- src/BizHawk.Client.Common/rewind/Zwinder.cs | 2 +- src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Client.Common/rewind/Zwinder.cs b/src/BizHawk.Client.Common/rewind/Zwinder.cs index 93d10a4f1d..93d62172bd 100644 --- a/src/BizHawk.Client.Common/rewind/Zwinder.cs +++ b/src/BizHawk.Client.Common/rewind/Zwinder.cs @@ -83,7 +83,7 @@ namespace BizHawk.Client.Common public void Dispose() { - // this possess no resources to dispose of, but other IRewinder impls might + _buffer.Dispose(); } public void Clear() diff --git a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs index ddb11ada7f..9f6a6c8685 100644 --- a/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs +++ b/src/BizHawk.Client.Common/rewind/ZwinderBuffer.cs @@ -7,7 +7,7 @@ using BizHawk.Common; namespace BizHawk.Client.Common { - public class ZwinderBuffer + public class ZwinderBuffer : IDisposable { /* Main goals: @@ -34,6 +34,12 @@ namespace BizHawk.Client.Common _useCompression = settings.UseCompression; } + public void Dispose() + { + _buffer.Dispose(); + } + + /// /// Number of states that could be in the state ringbuffer, Mask for the state ringbuffer ///