Close files, GC can take too long and the OS will trash us.

This commit is contained in:
2014-07-03 18:31:27 +01:00
parent ded61b9f99
commit 3cbb84be7f
3 changed files with 11 additions and 0 deletions

View File

@@ -102,6 +102,7 @@ namespace DiscImageChef.ImagePlugins
{
FileStream stream = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
stream.Seek(0, SeekOrigin.Begin);
stream.Close();
FileInfo fi = new FileInfo(imagePath);
string extension = Path.GetExtension(imagePath).ToLower();
@@ -294,6 +295,8 @@ namespace DiscImageChef.ImagePlugins
stream.Read(buffer, 0, (int)(length * sectorSize));
stream.Close();
return buffer;
}