File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -482,7 +482,7 @@ void WriteRun()
482
482
/// <summary>
483
483
/// Free any resources and other cleanup before garbage collection reclaims memory
484
484
/// </summary>
485
- public void Finalize ( )
485
+ ~ BZip2OutputStream ( )
486
486
{
487
487
Close ( ) ;
488
488
}
@@ -493,20 +493,19 @@ public void Finalize()
493
493
/// </summary>
494
494
public override void Close ( )
495
495
{
496
- if ( closed ) {
497
- return ;
498
- }
496
+ if ( ! closed ) {
497
+ closed = true ;
499
498
500
- if ( runLength > 0 ) {
501
- WriteRun ( ) ;
502
- }
499
+ if ( runLength > 0 ) {
500
+ WriteRun ( ) ;
501
+ }
503
502
504
- currentChar = - 1 ;
505
- EndBlock ( ) ;
506
- EndCompression ( ) ;
507
- closed = true ;
508
- Flush ( ) ;
509
- baseStream . Close ( ) ;
503
+ currentChar = - 1 ;
504
+ EndBlock ( ) ;
505
+ EndCompression ( ) ;
506
+ Flush ( ) ;
507
+ baseStream . Close ( ) ;
508
+ }
510
509
}
511
510
512
511
/// <summary>
You can’t perform that action at this time.
0 commit comments