mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-10-10 07:38:03 +00:00
fix disposal and add tests
This commit is contained in:
@@ -158,18 +158,18 @@ public partial class SharpCompressStream
|
||||
{
|
||||
return;
|
||||
}
|
||||
_isDisposed = true;
|
||||
if (LeaveOpen)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (ThrowOnDispose)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"Attempt to dispose of a {nameof(SharpCompressStream)} when {nameof(ThrowOnDispose)} is {ThrowOnDispose}"
|
||||
);
|
||||
}
|
||||
_isDisposed = true;
|
||||
await base.DisposeAsync();
|
||||
if (this.LeaveOpen)
|
||||
{
|
||||
return;
|
||||
}
|
||||
await Stream.DisposeAsync();
|
||||
if (_buffer != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user