mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix potential race condition
This commit is contained in:
@@ -766,6 +766,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// <param name="filter">Filter to use</param>
|
/// <param name="filter">Filter to use</param>
|
||||||
/// <param name="useTags">True if DatFile tags override splitting, false otherwise</param>
|
/// <param name="useTags">True if DatFile tags override splitting, false otherwise</param>
|
||||||
/// <returns>True if the DatFile was filtered, false on error</returns>
|
/// <returns>True if the DatFile was filtered, false on error</returns>
|
||||||
|
/// TODO: Re-evaluate what should be in here and see if we need to have a "Cleaner" class
|
||||||
public bool ApplyFilter(Filter filter, bool useTags)
|
public bool ApplyFilter(Filter filter, bool useTags)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -890,7 +891,8 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// <param name="inputs">List of inputs to use for renaming</param>
|
/// <param name="inputs">List of inputs to use for renaming</param>
|
||||||
public void ApplySuperDAT(List<ParentablePath> inputs)
|
public void ApplySuperDAT(List<ParentablePath> inputs)
|
||||||
{
|
{
|
||||||
Parallel.ForEach(Items.Keys, Globals.ParallelOptions, key =>
|
List<string> keys = Items.Keys.ToList();
|
||||||
|
Parallel.ForEach(keys, Globals.ParallelOptions, key =>
|
||||||
{
|
{
|
||||||
List<DatItem> items = Items[key].ToList();
|
List<DatItem> items = Items[key].ToList();
|
||||||
List<DatItem> newItems = new List<DatItem>();
|
List<DatItem> newItems = new List<DatItem>();
|
||||||
|
|||||||
Reference in New Issue
Block a user