From 97c8b8f8787da582769df5aacb4d4f1c392bb014 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Mon, 10 Feb 2020 09:40:44 +0100 Subject: [PATCH] Output: Fix thread safety crash in WriteFilesByClassTree --- Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs b/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs index 43e62934..552de153 100644 --- a/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs +++ b/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs @@ -89,7 +89,9 @@ public HashSet WriteFilesByClassTree(string outPath, bool separateAttr used.Add(type.Assembly); return used; }, - usedPartition => usedAssemblies.UnionWith(usedPartition) + usedPartition => { + lock (usedAssemblies) usedAssemblies.UnionWith(usedPartition); + } ); if (separateAttributes && usedAssemblies.Any())