mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Do not recycle filters list as it is not creating new filter instances
just reusing it.
This commit is contained in:
@@ -583,6 +583,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if(!string.IsNullOrEmpty(header.subchannelFile))
|
||||
{
|
||||
filtersList = new FiltersList();
|
||||
|
||||
do
|
||||
{
|
||||
subFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(),
|
||||
|
||||
@@ -590,13 +590,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
else
|
||||
DicConsole.ErrorWriteLine("BlindWrite5 image ends after expected position. Probably new version with different data. Errors may occur.");
|
||||
|
||||
FiltersList filtersList = new FiltersList();
|
||||
FiltersList filtersList;
|
||||
|
||||
filePaths = new List<DataFileCharacteristics>();
|
||||
foreach(BW5_DataFile dataFile in dataFiles)
|
||||
{
|
||||
DataFileCharacteristics chars = new DataFileCharacteristics();
|
||||
string path = Path.Combine(dataPath, dataFile.filename);
|
||||
filtersList = new FiltersList();
|
||||
|
||||
if(filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), path)) != null)
|
||||
{
|
||||
|
||||
@@ -615,6 +615,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
DicConsole.DebugWriteLine("CDRDAO plugin", "Found AUDIOFILE \"{1}\" at line {0}", line, MatchAudioFile.Groups["filename"].Value);
|
||||
|
||||
filtersList = new FiltersList();
|
||||
currenttrack.trackfile = new CDRDAOTrackFile();
|
||||
currenttrack.trackfile.datafilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), MatchAudioFile.Groups["filename"].Value));
|
||||
currenttrack.trackfile.datafile = MatchAudioFile.Groups["filename"].Value;
|
||||
@@ -645,7 +646,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
DicConsole.DebugWriteLine("CDRDAO plugin", "Found DATAFILE \"{1}\" at line {0}", line, MatchFile.Groups["filename"].Value);
|
||||
|
||||
currenttrack.trackfile = new CDRDAOTrackFile();
|
||||
filtersList = new FiltersList();
|
||||
currenttrack.trackfile = new CDRDAOTrackFile();
|
||||
currenttrack.trackfile.datafilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), MatchFile.Groups["filename"].Value));
|
||||
currenttrack.trackfile.datafile = MatchAudioFile.Groups["filename"].Value;
|
||||
currenttrack.trackfile.offset = MatchFile.Groups["base_offset"].Value != "" ? ulong.Parse(MatchFile.Groups["base_offset"].Value) : 0;
|
||||
|
||||
@@ -597,15 +597,17 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if(currenttrack.sequence != 0)
|
||||
{
|
||||
currentfile.sequence = currenttrack.sequence;
|
||||
currentfile.sequence = currenttrack.sequence;
|
||||
currenttrack.trackfile = currentfile;
|
||||
currenttrack.sectors = ((ulong)currentfile.datafilter.GetLength() - currentfile.offset) / CDRWinTrackTypeToBytesPerSector(currenttrack.tracktype);
|
||||
cuetracks[currenttrack.sequence - 1] = currenttrack;
|
||||
intrack = false;
|
||||
currenttrack = new CDRWinTrack();
|
||||
}
|
||||
|
||||
currentfile = new CDRWinTrackFile();
|
||||
filtersList = new FiltersList();
|
||||
}
|
||||
|
||||
//currentfile = new CDRWinTrackFile();
|
||||
string datafile = MatchFile.Groups[1].Value;
|
||||
currentfile.filetype = MatchFile.Groups[2].Value;
|
||||
|
||||
@@ -674,7 +676,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
|
||||
// File does exist, process it
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "File \"{0}\" found", currentfile.datafilter);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "File \"{0}\" found", currentfile.datafilter.GetFilename());
|
||||
|
||||
switch(currentfile.filetype)
|
||||
{
|
||||
@@ -1026,7 +1028,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack has SCMS");
|
||||
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack resides in file {0}, type defined as {1}, starting at byte {2}",
|
||||
discimage.tracks[i].trackfile.datafilter, discimage.tracks[i].trackfile.filetype, discimage.tracks[i].trackfile.offset);
|
||||
discimage.tracks[i].trackfile.datafilter.GetFilename(), discimage.tracks[i].trackfile.filetype, discimage.tracks[i].trackfile.offset);
|
||||
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tIndexes:");
|
||||
foreach(KeyValuePair<int, ulong> kvp in discimage.tracks[i].indexes)
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
GDITrack currentTrack;
|
||||
densitySeparationSectors = 0;
|
||||
|
||||
FiltersList filtersList = new FiltersList();
|
||||
FiltersList filtersList;
|
||||
|
||||
while(gdiStream.Peek() >= 0)
|
||||
{
|
||||
@@ -253,6 +253,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
TrackMatch.Groups["track"].Value, TrackMatch.Groups["start"].Value, TrackMatch.Groups["flags"].Value,
|
||||
TrackMatch.Groups["type"].Value, TrackMatch.Groups["filename"].Value, TrackMatch.Groups["offset"].Value, line);
|
||||
|
||||
filtersList = new FiltersList();
|
||||
currentTrack = new GDITrack();
|
||||
currentTrack.bps = ushort.Parse(TrackMatch.Groups["type"].Value);
|
||||
currentTrack.flags = (byte)(byte.Parse(TrackMatch.Groups["flags"].Value) * 0x10);
|
||||
|
||||
@@ -823,7 +823,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
int currentLocator = 0;
|
||||
bool locatorFound = false;
|
||||
string parentPath = null;
|
||||
FiltersList filters = new FiltersList();
|
||||
FiltersList filters;
|
||||
|
||||
while(!locatorFound && currentLocator < 8)
|
||||
{
|
||||
@@ -852,7 +852,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
if(parentPath != null)
|
||||
{
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Possible parent path: \"{0}\"", parentPath);
|
||||
Filter parentFilter = filters.GetFilter(Path.Combine(imageFilter.GetParentFolder(), parentPath));
|
||||
Filter parentFilter = new FiltersList().GetFilter(Path.Combine(imageFilter.GetParentFolder(), parentPath));
|
||||
|
||||
if(parentFilter != null)
|
||||
locatorFound = true;
|
||||
@@ -868,7 +868,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
else
|
||||
{
|
||||
parentImage = new VHD();
|
||||
Filter parentFilter = filters.GetFilter(Path.Combine(imageFilter.GetParentFolder(), parentPath));
|
||||
Filter parentFilter = new FiltersList().GetFilter(Path.Combine(imageFilter.GetParentFolder(), parentPath));
|
||||
|
||||
if(parentFilter == null)
|
||||
throw new ImageNotSupportedException("(VirtualPC plugin): Cannot find parent image filter");
|
||||
|
||||
@@ -602,7 +602,6 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
parentImage = new VHDX();
|
||||
bool parentWorks = false;
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter parentFilter;
|
||||
|
||||
foreach(VHDXParentLocatorEntry parentEntry in vPars)
|
||||
@@ -621,7 +620,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
try
|
||||
{
|
||||
parentFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), entryValue));
|
||||
parentFilter = new FiltersList().GetFilter(Path.Combine(imageFilter.GetParentFolder(), entryValue));
|
||||
if(parentFilter != null && parentImage.OpenImage(parentFilter))
|
||||
{
|
||||
parentWorks = true;
|
||||
@@ -634,7 +633,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
try
|
||||
{
|
||||
parentFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), relEntry));
|
||||
parentFilter = new FiltersList().GetFilter(Path.Combine(imageFilter.GetParentFolder(), relEntry));
|
||||
if(parentFilter != null && parentImage.OpenImage(parentFilter))
|
||||
{
|
||||
parentWorks = true;
|
||||
@@ -653,7 +652,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
try
|
||||
{
|
||||
parentFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), entryValue));
|
||||
parentFilter = new FiltersList().GetFilter(Path.Combine(imageFilter.GetParentFolder(), entryValue));
|
||||
if(parentFilter != null && parentImage.OpenImage(parentFilter))
|
||||
{
|
||||
parentWorks = true;
|
||||
|
||||
@@ -327,8 +327,6 @@ namespace DiscImageChef.DiscImages
|
||||
extents = new Dictionary<ulong, VMwareExtent>();
|
||||
ulong currentSector = 0;
|
||||
|
||||
FiltersList filtersList = new FiltersList();
|
||||
|
||||
bool matchedCyls = false, matchedHds = false, matchedSpt = false;
|
||||
|
||||
if(cowD)
|
||||
@@ -347,7 +345,7 @@ namespace DiscImageChef.DiscImages
|
||||
if(!File.Exists(curPath))
|
||||
break;
|
||||
|
||||
Filter extentFilter = filtersList.GetFilter(curPath);
|
||||
Filter extentFilter = new FiltersList().GetFilter(curPath);
|
||||
Stream extentStream = extentFilter.GetDataForkStream();
|
||||
|
||||
if(stream.Length > Marshal.SizeOf(vmCHdr))
|
||||
@@ -450,7 +448,7 @@ namespace DiscImageChef.DiscImages
|
||||
VMwareExtent newExtent = new VMwareExtent();
|
||||
newExtent.access = MatchExtent.Groups["access"].Value;
|
||||
if(!embedded)
|
||||
newExtent.filter = filtersList.GetFilter(Path.Combine(Path.GetDirectoryName(imageFilter.GetBasePath()), MatchExtent.Groups["filename"].Value));
|
||||
newExtent.filter = new FiltersList().GetFilter(Path.Combine(Path.GetDirectoryName(imageFilter.GetBasePath()), MatchExtent.Groups["filename"].Value));
|
||||
else
|
||||
newExtent.filter = imageFilter;
|
||||
uint.TryParse(MatchExtent.Groups["offset"].Value, out newExtent.offset);
|
||||
@@ -672,7 +670,7 @@ namespace DiscImageChef.DiscImages
|
||||
|
||||
if(hasParent)
|
||||
{
|
||||
Filter parentFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), parentName));
|
||||
Filter parentFilter = new FiltersList().GetFilter(Path.Combine(imageFilter.GetParentFolder(), parentName));
|
||||
if(parentFilter == null)
|
||||
throw new Exception(string.Format("Cannot find parent \"{0}\".", parentName));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user