From 8a40fc7a3aa6e0d60262b003f8e5de5e6e5fc2f3 Mon Sep 17 00:00:00 2001 From: Zarunbal Date: Thu, 16 Nov 2017 01:08:40 +0100 Subject: [PATCH] Moved the instantiation of LogLine in ReReadBuffer into the while loop This change avoids the Bug that if a buffer gets ReRead that all lines are the last because of only using one reference which is updated in this loop. #10 --- src/LogExpert/Classes/Log/LogfileReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LogExpert/Classes/Log/LogfileReader.cs b/src/LogExpert/Classes/Log/LogfileReader.cs index efb7a1d2..0263d7c7 100644 --- a/src/LogExpert/Classes/Log/LogfileReader.cs +++ b/src/LogExpert/Classes/Log/LogfileReader.cs @@ -1307,7 +1307,6 @@ private void ReReadBuffer(LogBuffer logBuffer) try { ILogStreamReader reader = GetLogStreamReader(fileStream, EncodingOptions, UseNewReader); - LogLine logLine = new LogLine(); string line; long filePos = logBuffer.StartPos; @@ -1329,6 +1328,7 @@ private void ReReadBuffer(LogBuffer logBuffer) dropCount++; continue; } + LogLine logLine = new LogLine(); logLine.FullLine = line; logLine.LineNumber = logBuffer.StartLine + logBuffer.LineCount;