diff --git a/Cpp2IL.Core/Cpp2IL.Core.csproj b/Cpp2IL.Core/Cpp2IL.Core.csproj
index 7f2a44f7..fc6aae7c 100644
--- a/Cpp2IL.Core/Cpp2IL.Core.csproj
+++ b/Cpp2IL.Core/Cpp2IL.Core.csproj
@@ -6,9 +6,9 @@
enable
Samboy063.Cpp2IL.Core
Samboy063
- 2022.0.1
- 2022.0.1
- 2022.0.1
+ 2022.0.2
+ 2022.0.2
+ 2022.0.2
Copyright © Samboy063 2019-2022
true
MIT
diff --git a/Cpp2IL.Core/Cpp2IlApi.cs b/Cpp2IL.Core/Cpp2IlApi.cs
index 0704819b..5f47c1a0 100644
--- a/Cpp2IL.Core/Cpp2IlApi.cs
+++ b/Cpp2IL.Core/Cpp2IlApi.cs
@@ -171,7 +171,7 @@ public static void InitializeLibCpp2Il(string assemblyPath, string metadataPath,
public static void InitializeLibCpp2Il(string assemblyPath, string metadataPath, int[] unityVersion, bool allowUserToInputAddresses = false)
{
if (IsLibInitialized())
- ResetInternalState();
+ DisposeAndCleanupAll();
ConfigureLib(allowUserToInputAddresses);
@@ -199,7 +199,7 @@ public static void InitializeLibCpp2Il(byte[] assemblyData, byte[] metadataData,
public static void InitializeLibCpp2Il(byte[] assemblyData, byte[] metadataData, int[] unityVersion, bool allowUserToInputAddresses = false)
{
if (IsLibInitialized())
- ResetInternalState();
+ DisposeAndCleanupAll();
ConfigureLib(allowUserToInputAddresses);
@@ -216,7 +216,10 @@ public static void InitializeLibCpp2Il(byte[] assemblyData, byte[] metadataData,
}
}
- private static void ResetInternalState()
+ ///
+ /// Clears all internal caches, lists, references, etc, disposes of the MemoryStream for the binary and metadata, and resets the state of the library.
+ ///
+ public static void DisposeAndCleanupAll()
{
SharedState.Clear();
diff --git a/Cpp2IL/Properties/AssemblyInfo.cs b/Cpp2IL/Properties/AssemblyInfo.cs
index 4cd4571b..80422349 100644
--- a/Cpp2IL/Properties/AssemblyInfo.cs
+++ b/Cpp2IL/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2022.0.1")]
-[assembly: AssemblyFileVersion("2022.0.1")]
\ No newline at end of file
+[assembly: AssemblyVersion("2022.0.2")]
+[assembly: AssemblyFileVersion("2022.0.2")]
\ No newline at end of file
diff --git a/LibCpp2IL/LibCpp2IL.csproj b/LibCpp2IL/LibCpp2IL.csproj
index d24925a8..512ff35f 100644
--- a/LibCpp2IL/LibCpp2IL.csproj
+++ b/LibCpp2IL/LibCpp2IL.csproj
@@ -6,7 +6,7 @@
9
netstandard2.0
Samboy063.LibCpp2IL
- 2022.0.1
+ 2022.0.2
true
MIT
git
diff --git a/LibCpp2IL/LibCpp2IlMain.cs b/LibCpp2IL/LibCpp2IlMain.cs
index 5fd8e51c..b7c3b1b2 100644
--- a/LibCpp2IL/LibCpp2IlMain.cs
+++ b/LibCpp2IL/LibCpp2IlMain.cs
@@ -33,6 +33,12 @@ public static void Reset()
LibCpp2IlGlobalMapper.Reset();
LibCpp2ILUtils.Reset();
MethodsByPtr.Clear();
+
+ MetadataVersion = 0f;
+ Binary?.Dispose();
+ TheMetadata?.Dispose();
+ Binary = null;
+ TheMetadata = null;
}
public static List? GetManagedMethodImplementationsAtAddress(ulong addr)
diff --git a/LibCpp2IL/Properties/AssemblyInfo.cs b/LibCpp2IL/Properties/AssemblyInfo.cs
index f8a757b6..f4ffc1c1 100644
--- a/LibCpp2IL/Properties/AssemblyInfo.cs
+++ b/LibCpp2IL/Properties/AssemblyInfo.cs
@@ -8,8 +8,8 @@
[assembly: AssemblyCopyright("Copyright © Samboy063 2019-2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("2022.0.1")]
-[assembly: AssemblyFileVersion("2022.0.1")]
+[assembly: AssemblyVersion("2022.0.2")]
+[assembly: AssemblyFileVersion("2022.0.2")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
diff --git a/WasmDisassembler/WasmDisassembler.csproj b/WasmDisassembler/WasmDisassembler.csproj
index eeec2de5..3a385a05 100644
--- a/WasmDisassembler/WasmDisassembler.csproj
+++ b/WasmDisassembler/WasmDisassembler.csproj
@@ -6,7 +6,7 @@
enable
10
Samboy063.WasmDisassembler
- 2022.0.0
+ 2022.0.2
true
MIT
git