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!
This commit is contained in:
Hathor86 2016-01-03 00:52:09 +01:00
parent 3844bf3c12
commit f0ab9edc10
1 changed files with 2 additions and 1 deletions

View File

@ -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);