From 81f12b3e5b6bcdea9464edcf6a83e178b032e534 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sat, 18 Jul 2020 21:23:34 +0200 Subject: [PATCH] AppModel: Fix crash bug when building multiple times --- Il2CppInspector.Common/Model/AppModel.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Il2CppInspector.Common/Model/AppModel.cs b/Il2CppInspector.Common/Model/AppModel.cs index 0f99181..dcb367a 100644 --- a/Il2CppInspector.Common/Model/AppModel.cs +++ b/Il2CppInspector.Common/Model/AppModel.cs @@ -107,6 +107,11 @@ namespace Il2CppInspector.Model // (via the constructor of CppDeclarationGenerator, in InheritanceStyle) // If no target C++ compiler is specified, it will be set to match the one assumed to have been used to compile the binary public AppModel Build(UnityVersion unityVersion = null, CppCompilerType compiler = CppCompilerType.BinaryFormat) { + // Reset in case this is not the first build + Methods.Clear(); + Types.Clear(); + Strings.Clear(); + // Set target compiler TargetCompiler = compiler == CppCompilerType.BinaryFormat ? CppCompiler.GuessFromImage(ILModel.Package.BinaryImage) : compiler;