summary refs log tree commit diff
path: root/crypto/src/util/zlib/ZDeflaterOutputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/util/zlib/ZDeflaterOutputStream.cs')
-rw-r--r--crypto/src/util/zlib/ZDeflaterOutputStream.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crypto/src/util/zlib/ZDeflaterOutputStream.cs b/crypto/src/util/zlib/ZDeflaterOutputStream.cs
index 7ff6d31c8..5a70df21d 100644
--- a/crypto/src/util/zlib/ZDeflaterOutputStream.cs
+++ b/crypto/src/util/zlib/ZDeflaterOutputStream.cs
@@ -136,6 +136,24 @@ namespace Org.BouncyCastle.Utilities.Zlib {
             z=null;
         }
         
+#if PORTABLE
+        protected override void Disposing(bool disposing)
+        {
+            if (disposing)
+            {
+                try{
+                    try{Finish();}
+                    catch (IOException) {}
+                }
+                finally{
+                    End();
+                    Platform.Dispose(outp);
+                    outp=null;
+                }
+            }
+            base.Dispose(disposing);
+        }
+#else
         public override void Close() {
             try{
                 try{Finish();}
@@ -147,5 +165,6 @@ namespace Org.BouncyCastle.Utilities.Zlib {
                 outp=null;
             }
         }
+#endif
     }
 }