summary refs log tree commit diff
path: root/crypto/bzip2/src/CBZip2OutputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bzip2/src/CBZip2OutputStream.cs')
-rw-r--r--crypto/bzip2/src/CBZip2OutputStream.cs24
1 files changed, 21 insertions, 3 deletions
diff --git a/crypto/bzip2/src/CBZip2OutputStream.cs b/crypto/bzip2/src/CBZip2OutputStream.cs

index bf43a6a6c..ffac073fb 100644 --- a/crypto/bzip2/src/CBZip2OutputStream.cs +++ b/crypto/bzip2/src/CBZip2OutputStream.cs
@@ -25,6 +25,8 @@ using System; using System.IO; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Apache.Bzip2 { /** @@ -384,17 +386,33 @@ namespace Org.BouncyCastle.Apache.Bzip2 // Close(); // } +#if PORTABLE + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (closed) + return; + + Finish(); + closed = true; + Platform.Dispose(this.bsStream); + } + base.Dispose(disposing); + } +#else public override void Close() { - if (closed) { + if (closed) return; - } Finish(); closed = true; + Platform.Dispose(this.bsStream); + base.Close(); - bsStream.Close(); } +#endif public void Finish() { if (finished) {