diff --git a/BizHawk.Client.Common/movie/bk2/StringLogs.cs b/BizHawk.Client.Common/movie/bk2/StringLogs.cs index 3125df524e..08c3e4b28e 100644 --- a/BizHawk.Client.Common/movie/bk2/StringLogs.cs +++ b/BizHawk.Client.Common/movie/bk2/StringLogs.cs @@ -65,18 +65,18 @@ namespace BizHawk.Client.Common BinaryReader br; bool mDisk; - Stream stream; + Stream stream; public StreamStringLog(bool disk) - { - mDisk = disk; - if (disk) - { - var path = TempFileCleaner.GetTempFilename("movieOnDisk"); - stream = new FileStream(path, FileMode.Create, System.Security.AccessControl.FileSystemRights.FullControl, FileShare.None, 4 * 1024, FileOptions.DeleteOnClose); - } - else - { - stream = new AWEMemoryStream(); + { + mDisk = disk; + if (disk) + { + var path = TempFileCleaner.GetTempFilename("movieOnDisk"); + stream = new FileStream(path, FileMode.Create, System.Security.AccessControl.FileSystemRights.FullControl, FileShare.None, 4 * 1024, FileOptions.DeleteOnClose); + } + else + { + stream = new AWEMemoryStream(); } bw = new BinaryWriter(stream); br = new BinaryReader(stream); @@ -105,7 +105,8 @@ namespace BizHawk.Client.Common } public void Add(string str) - { + { + stream.Position = stream.Length; Offsets.Add(stream.Position); bw.Write(str); bw.Flush(); @@ -134,7 +135,8 @@ namespace BizHawk.Client.Common } public void Insert(int index, string val) - { + { + stream.Position = stream.Length; Offsets.Insert(index, stream.Position); bw.Write(val); bw.Flush();