summary refs log tree commit diff
path: root/crypto/src/openpgp/WrappedGeneratorStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/openpgp/WrappedGeneratorStream.cs')
-rw-r--r--crypto/src/openpgp/WrappedGeneratorStream.cs11
1 files changed, 3 insertions, 8 deletions
diff --git a/crypto/src/openpgp/WrappedGeneratorStream.cs b/crypto/src/openpgp/WrappedGeneratorStream.cs
index 6f96dc9b8..c985a7a05 100644
--- a/crypto/src/openpgp/WrappedGeneratorStream.cs
+++ b/crypto/src/openpgp/WrappedGeneratorStream.cs
@@ -8,7 +8,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
 	internal sealed class WrappedGeneratorStream
 		: FilterStream
 	{
-		private IStreamGenerator m_generator;
+		private readonly IStreamGenerator m_generator;
 
 		internal WrappedGeneratorStream(IStreamGenerator generator, Stream s)
 			: base(s)
@@ -18,14 +18,9 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
 
         protected override void Dispose(bool disposing)
         {
-			if (m_generator != null)
+			if (disposing)
 			{
-				if (disposing)
-				{
-					m_generator.Close();
-				}
-
-				m_generator = null;
+				m_generator.Dispose();
 			}
 
 			Detach(disposing);