1 files changed, 17 insertions, 4 deletions
diff --git a/crypto/src/util/io/TeeOutputStream.cs b/crypto/src/util/io/TeeOutputStream.cs
index fe3a7586a..a6c7fd5b5 100644
--- a/crypto/src/util/io/TeeOutputStream.cs
+++ b/crypto/src/util/io/TeeOutputStream.cs
@@ -18,13 +18,26 @@ namespace Org.BouncyCastle.Utilities.IO
this.tee = tee;
}
- public override void Close()
+#if PORTABLE
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ Platform.Dispose(output);
+ Platform.Dispose(tee);
+ }
+ base.Dispose(disposing);
+ }
+#else
+ public override void Close()
{
- output.Close();
- tee.Close();
+ Platform.Dispose(output);
+ Platform.Dispose(tee);
+ base.Close();
}
+#endif
- public override void Write(byte[] buffer, int offset, int count)
+ public override void Write(byte[] buffer, int offset, int count)
{
output.Write(buffer, offset, count);
tee.Write(buffer, offset, count);
|