From 297b3016f82595799bbd8cf8ffc8b201566df251 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Thu, 4 Feb 2021 12:58:24 +0100 Subject: [PATCH] C#: Fix crash on machines/VMs with 1 hardware thread (#134) --- Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs b/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs index b2213cf..4f5bdd2 100644 --- a/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs +++ b/Il2CppInspector.Common/Outputs/CSharpCodeStubs.cs @@ -205,7 +205,7 @@ namespace Il2CppInspector.Outputs var results = new ConcurrentBag>(); // Generate each type - Parallel.ForEach(types, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount / 2 }, + Parallel.ForEach(types, new ParallelOptions { MaxDegreeOfParallelism = Math.Max(Environment.ProcessorCount / 2, 1) }, () => new Dictionary(), (type, _, dict) => { // Skip namespace and any children if requested