Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Close wrapped file when disposing a File.Stream
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbenic committed Jan 25, 2017
1 parent b0beae8 commit c1ba104
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Script/AtomicNET/AtomicNET/IO/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ public override void Write(byte[] buffer, int offset, int count)

file.Write(buffer, offset, count);
}

protected override void Dispose(bool disposing)
{
if (file != null)
{
file.Close();
file = null;
}

base.Dispose(disposing);
}
}

public System.IO.Stream ToStream()
Expand Down

0 comments on commit c1ba104

Please sign in to comment.