mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SimpleSort] Make sure memory stream is disposed
This commit is contained in:
@@ -456,24 +456,26 @@ namespace SabreTools.Helper
|
|||||||
// If there's a match, get the new information from the stream
|
// If there's a match, get the new information from the stream
|
||||||
if (rule.Tests != null && rule.Tests.Count != 0)
|
if (rule.Tests != null && rule.Tests.Count != 0)
|
||||||
{
|
{
|
||||||
MemoryStream output = new MemoryStream();
|
using (MemoryStream output = new MemoryStream())
|
||||||
FileStream input = File.OpenRead(file);
|
{
|
||||||
Skippers.TransformStream(input, output, rule, _logger, false, true);
|
FileStream input = File.OpenRead(file);
|
||||||
Rom romNH = FileTools.GetSingleStreamInfo(output);
|
Skippers.TransformStream(input, output, rule, _logger, false, true);
|
||||||
romNH.Name = "HEAD::" + rom.Name;
|
Rom romNH = FileTools.GetSingleStreamInfo(output);
|
||||||
romNH.Machine.Name = rom.Machine.Name;
|
romNH.Name = "HEAD::" + rom.Name;
|
||||||
|
romNH.Machine.Name = rom.Machine.Name;
|
||||||
|
|
||||||
// Add the rom information to the Dat
|
// Add the rom information to the Dat
|
||||||
key = romNH.HashData.Size + "-" + romNH.HashData.CRC;
|
key = romNH.HashData.Size + "-" + romNH.HashData.CRC;
|
||||||
if (matchdat.Files.ContainsKey(key))
|
if (matchdat.Files.ContainsKey(key))
|
||||||
{
|
{
|
||||||
matchdat.Files[key].Add(romNH);
|
matchdat.Files[key].Add(romNH);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<Rom> temp = new List<Rom>();
|
List<Rom> temp = new List<Rom>();
|
||||||
temp.Add(romNH);
|
temp.Add(romNH);
|
||||||
matchdat.Files.Add(key, temp);
|
matchdat.Files.Add(key, temp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user