mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-07-12 20:17:05 +00:00
Fixes Double Dispose() of ZipWritingStream #294 https://github.com/adamhathcock/sharpcompress/issues/294 (#295)
This commit is contained in:
committed by
Adam Hathcock
parent
0f511c4b2a
commit
08fee76b4e
@@ -276,6 +276,7 @@ namespace SharpCompress.Writers.Zip
|
||||
|
||||
// Flag to prevent throwing exceptions on Dispose
|
||||
private bool limitsExceeded;
|
||||
private bool isDisposed;
|
||||
|
||||
internal ZipWritingStream(ZipWriter writer, Stream originalStream, ZipCentralDirectoryEntry entry,
|
||||
ZipCompressionMethod zipCompressionMethod, CompressionLevel compressionLevel)
|
||||
@@ -344,6 +345,13 @@ namespace SharpCompress.Writers.Zip
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (isDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
isDisposed = true;
|
||||
|
||||
base.Dispose(disposing);
|
||||
if (disposing)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user