From f0ab9edc1022a5504fee1464f110af58ffc1b7b9 Mon Sep 17 00:00:00 2001 From: Hathor86 Date: Sun, 3 Jan 2016 00:52:09 +0100 Subject: [PATCH] Attempt to fix OutOfMemory when saving states (I guess it works) Just add an EnsureCapacity() before appending log. I didn't have any crash yet compare to current release. Let's hope! --- BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs b/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs index 99425ac9ed..a7e591b2e8 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Movie.InputLog.cs @@ -299,8 +299,9 @@ namespace BizHawk.Client.Common var lg = new Bk2LogEntryGenerator(LogKey); lg.SetSource(Global.MovieOutputHardpoint); - var sb = new StringBuilder(); + var sb = new StringBuilder(); sb.AppendLine(lg.GenerateLogKey()); + sb.EnsureCapacity(sb.Capacity + _log.Count); foreach (var record in _log) { sb.AppendLine(record);