From 9ead11b02826296eb945319b0693ef5d49d23d79 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 28 Aug 2020 10:48:27 -0700 Subject: [PATCH] Fix potential race condition --- SabreTools.Library/DatFiles/DatFile.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index aa66538a..1e1b1596 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -766,6 +766,7 @@ namespace SabreTools.Library.DatFiles /// Filter to use /// True if DatFile tags override splitting, false otherwise /// True if the DatFile was filtered, false on error + /// 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) { try @@ -890,7 +891,8 @@ namespace SabreTools.Library.DatFiles /// List of inputs to use for renaming public void ApplySuperDAT(List inputs) { - Parallel.ForEach(Items.Keys, Globals.ParallelOptions, key => + List keys = Items.Keys.ToList(); + Parallel.ForEach(keys, Globals.ParallelOptions, key => { List items = Items[key].ToList(); List newItems = new List();