Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pypy-vrc committed Jan 25, 2020
1 parent c7f06e9 commit 14bd28d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions LogWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class LogWatcher
{
private static readonly ReaderWriterLockSlim m_Lock = new ReaderWriterLockSlim();
private static List<string[]> m_GameLog = new List<string[]>();
private static string m_RecentDestination = string.Empty;
private static Thread m_Thread;
private static bool m_Reset;

Expand All @@ -47,6 +48,7 @@ public static void Init()
if (m_Reset)
{
m_Reset = false;
m_RecentDestination = string.Empty;
D.Clear();
m_Lock.EnterWriteLock();
try
Expand Down Expand Up @@ -110,7 +112,6 @@ public static void Exit()

public static void Parse(FileInfo info, ref long position)
{
var recentDestination = string.Empty;
try
{
using (var stream = info.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
Expand Down Expand Up @@ -140,7 +141,7 @@ public static void Parse(FileInfo info, ref long position)
// no instance info
continue;
}
recentDestination = destination;
m_RecentDestination = destination;
var item = new[]
{
ConvertLogTimeToISO8601(s),
Expand All @@ -167,9 +168,9 @@ public static void Parse(FileInfo info, ref long position)
string.Compare(s, 56, "or ", 0, "or ".Length, StringComparison.Ordinal) != 0)
{
var location = s.Substring(56);
if (recentDestination.Equals(location))
if (m_RecentDestination.Equals(location))
{
recentDestination = string.Empty; // only once
m_RecentDestination = string.Empty; // only once
continue;
}
var item = new[]
Expand Down

0 comments on commit 14bd28d

Please sign in to comment.