mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Close files, GC can take too long and the OS will trash us.
This commit is contained in:
@@ -143,6 +143,7 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
byte[] buffer = new byte[0x58];
|
byte[] buffer = new byte[0x58];
|
||||||
byte[] pString = new byte[64];
|
byte[] pString = new byte[64];
|
||||||
stream.Read(buffer, 0, 0x58);
|
stream.Read(buffer, 0, 0x58);
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
// Incorrect pascal string length, not DC42
|
// Incorrect pascal string length, not DC42
|
||||||
if (buffer[0] > 63)
|
if (buffer[0] > 63)
|
||||||
@@ -221,6 +222,7 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
byte[] buffer = new byte[0x58];
|
byte[] buffer = new byte[0x58];
|
||||||
byte[] pString = new byte[64];
|
byte[] pString = new byte[64];
|
||||||
stream.Read(buffer, 0, 0x58);
|
stream.Read(buffer, 0, 0x58);
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
// Incorrect pascal string length, not DC42
|
// Incorrect pascal string length, not DC42
|
||||||
if (buffer[0] > 63)
|
if (buffer[0] > 63)
|
||||||
@@ -355,6 +357,8 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
|
|
||||||
stream.Read(buffer, 0, (int)(length * bps));
|
stream.Read(buffer, 0, (int)(length * bps));
|
||||||
|
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,6 +384,8 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
|
|
||||||
stream.Read(buffer, 0, (int)(length * bptag));
|
stream.Read(buffer, 0, (int)(length * bptag));
|
||||||
|
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
FileStream stream = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
|
FileStream stream = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
|
||||||
|
|
||||||
stream.Read(headerBytes, 0, 12);
|
stream.Read(headerBytes, 0, 12);
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
header.signature = BitConverter.ToUInt16(headerBytes, 0);
|
header.signature = BitConverter.ToUInt16(headerBytes, 0);
|
||||||
|
|
||||||
@@ -564,6 +565,7 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
biggestSectorSize = (uint)decodedData.Length;
|
biggestSectorSize = (uint)decodedData.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stream.Close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
{
|
{
|
||||||
FileStream stream = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
|
FileStream stream = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
|
||||||
stream.Seek(0, SeekOrigin.Begin);
|
stream.Seek(0, SeekOrigin.Begin);
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
FileInfo fi = new FileInfo(imagePath);
|
FileInfo fi = new FileInfo(imagePath);
|
||||||
string extension = Path.GetExtension(imagePath).ToLower();
|
string extension = Path.GetExtension(imagePath).ToLower();
|
||||||
@@ -294,6 +295,8 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
|
|
||||||
stream.Read(buffer, 0, (int)(length * sectorSize));
|
stream.Read(buffer, 0, (int)(length * sectorSize));
|
||||||
|
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user