Bring back disposal of stream after copy-out to `MemoryStream`

Was there in previous code and got removed in the refactor. I'd rather
have it than not.
This commit is contained in:
Bartłomiej Dach 2023-09-14 19:36:33 +02:00
parent 57f32b177d
commit c8b18acd4d
No known key found for this signature in database
1 changed files with 3 additions and 0 deletions

View File

@ -59,8 +59,11 @@ public ArchiveReader GetReader()
}
if (Stream is not MemoryStream memoryStream)
{
// Path used primarily in tests (converting `ManifestResourceStream`s to `MemoryStream`s).
memoryStream = new MemoryStream(Stream.ReadAllBytesToArray());
Stream.Dispose();
}
if (ZipUtils.IsZipArchive(memoryStream))
return new ZipArchiveReader(memoryStream, Path);