mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-25 08:24:58 +00:00
clear and null check
This commit is contained in:
@@ -24,6 +24,7 @@ internal class OutWindow : IDisposable
|
||||
if (_windowSize != windowSize)
|
||||
{
|
||||
_buffer = ArrayPool<byte>.Shared.Rent(windowSize);
|
||||
Array.Clear(_buffer, 0, windowSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -40,6 +41,10 @@ internal class OutWindow : IDisposable
|
||||
public void Dispose()
|
||||
{
|
||||
ReleaseStream();
|
||||
if (_buffer is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ArrayPool<byte>.Shared.Return(_buffer);
|
||||
_buffer = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user