1 files changed, 10 insertions, 6 deletions
diff --git a/crypto/src/util/io/TeeOutputStream.cs b/crypto/src/util/io/TeeOutputStream.cs
index fe3a7586a..cebca89fe 100644
--- a/crypto/src/util/io/TeeOutputStream.cs
+++ b/crypto/src/util/io/TeeOutputStream.cs
@@ -18,12 +18,16 @@ namespace Org.BouncyCastle.Utilities.IO
this.tee = tee;
}
- public override void Close()
- {
- output.Close();
- tee.Close();
- }
-
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ output.Dispose();
+ tee.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
public override void Write(byte[] buffer, int offset, int count)
{
output.Write(buffer, offset, count);
|