Skip to content

Commit 81a82ac

Browse files
committed
fix: 修复判断条件和内存释放问题。
1 parent c51c0ab commit 81a82ac

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Runtime/Text/SourceReader/PartialSourceReader.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ protected override void FreeInternal(int index)
407407
first = first.Next;
408408
buffer.Prev = buffer;
409409
buffer.Next = buffer;
410+
buffer.Text = string.Empty;
410411
first.Prev = first;
411412
}
412413
}

Runtime/Text/SourceReader/SourceReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static SourceReader Create(string source, int start, int length)
6565
{
6666
throw CommonExceptions.ArgumentNegative(start);
6767
}
68-
if (start + length < 0 || start + length >= source.Length)
68+
if (start + length < 0 || start + length > source.Length)
6969
{
7070
throw CommonExceptions.ArgumentNegative(length);
7171
}

0 commit comments

Comments
 (0)