diff options
Diffstat (limited to 'crypto/src/openpgp/PgpCompressedDataGenerator.cs')
-rw-r--r-- | crypto/src/openpgp/PgpCompressedDataGenerator.cs | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/crypto/src/openpgp/PgpCompressedDataGenerator.cs b/crypto/src/openpgp/PgpCompressedDataGenerator.cs index 271dfac7a..ecd09fd4f 100644 --- a/crypto/src/openpgp/PgpCompressedDataGenerator.cs +++ b/crypto/src/openpgp/PgpCompressedDataGenerator.cs @@ -148,33 +148,21 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp } } - #region IDisposable - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (disposing) + [Obsolete("Dispose any opened Stream directly")] + public void Close() + { + if (dOut != null) { - if (dOut != null) + if (dOut != pkOut) { - if (dOut != pkOut) - { - dOut.Dispose(); - } - dOut = null; - - pkOut.Finish(); - pkOut.Flush(); - pkOut = null; + dOut.Dispose(); } + dOut = null; + + pkOut.Finish(); + pkOut.Flush(); + pkOut = null; } } - - #endregion } } |