From aa3f916e7bd4a5b244563984886bf72f9903d0dd Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 9 Nov 2015 20:52:04 -0600 Subject: [PATCH] fix error in previous rewind-related commit. im thinking it might not have been such a great idea now... --- BizHawk.Client.Common/rewind/Rewinder.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/BizHawk.Client.Common/rewind/Rewinder.cs b/BizHawk.Client.Common/rewind/Rewinder.cs index 6cacd80e55..03c01aa2ed 100644 --- a/BizHawk.Client.Common/rewind/Rewinder.cs +++ b/BizHawk.Client.Common/rewind/Rewinder.cs @@ -96,6 +96,12 @@ namespace BizHawk.Client.Common public void DoRewindSettings() { + if (_rewindThread != null) + { + _rewindThread.Dispose(); + _rewindThread = null; + } + if (Global.Emulator.HasSavestates()) { // This is the first frame. Capture the state, and put it in LastState for future deltas to be compared against. @@ -145,11 +151,6 @@ namespace BizHawk.Client.Common _rewindBuffer = new StreamBlobDatabase(Global.Config.Rewind_OnDisk, capacity, BufferManage); - if (_rewindThread != null) - { - _rewindThread.Dispose(); - } - _rewindThread = new RewindThreader(this, Global.Config.Rewind_IsThreaded); } } @@ -157,7 +158,7 @@ namespace BizHawk.Client.Common public void Rewind(int frames) { - if (Global.Emulator.HasSavestates()) + if (Global.Emulator.HasSavestates() && _rewindThread != null) { _rewindThread.Rewind(frames); }