diff --git a/src/BZip2/BZip2OutputStream.cs b/src/BZip2/BZip2OutputStream.cs index 582f7a4e3..551bead6c 100644 --- a/src/BZip2/BZip2OutputStream.cs +++ b/src/BZip2/BZip2OutputStream.cs @@ -384,29 +384,33 @@ override protected void Dispose(bool disposing) #endif { try { + try { #if !NET_1_0 && !NET_1_1 && !NETCF_1_0 - base.Dispose(disposing); + base.Dispose(disposing); #endif - if( !disposed_ ) { - disposed_=true; + if( !disposed_ ) { + disposed_=true; - if( runLength>0 ) { - WriteRun(); - } + if( runLength>0 ) { + WriteRun(); + } - currentChar=-1; - EndBlock(); - EndCompression(); - Flush(); + currentChar=-1; + EndBlock(); + EndCompression(); + Flush(); + } } - } - finally { - if ( disposing ) { - if ( IsStreamOwner ) { - baseStream.Close(); + finally { + if ( disposing ) { + if ( IsStreamOwner ) { + baseStream.Close(); + } } } } + catch { + } } ///