1 files changed, 17 insertions, 4 deletions
diff --git a/crypto/src/util/io/TeeInputStream.cs b/crypto/src/util/io/TeeInputStream.cs
index 373df4502..6996f3fbb 100644
--- a/crypto/src/util/io/TeeInputStream.cs
+++ b/crypto/src/util/io/TeeInputStream.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(input);
+ Platform.Dispose(tee);
+ }
+ base.Dispose(disposing);
+ }
+#else
+ public override void Close()
{
- input.Close();
- tee.Close();
+ Platform.Dispose(input);
+ Platform.Dispose(tee);
+ base.Close();
}
+#endif
- public override int Read(byte[] buf, int off, int len)
+ public override int Read(byte[] buf, int off, int len)
{
int i = input.Read(buf, off, len);
|