From d8a8873d4113b8642e5925f1668112f67fddc738 Mon Sep 17 00:00:00 2001 From: Sewer56 Date: Sat, 5 Jan 2019 08:00:05 +0000 Subject: [PATCH] Implement Initializer in Assembler Performs automatic cleanup of unmanaged resources when any Assembler instance becomes Garbage Collected. --- Source/Reloaded.Assembler/Assembler.cs | 9 ++++++++- Source/Reloaded.Assembler/Reloaded.Assembler.csproj | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Reloaded.Assembler/Assembler.cs b/Source/Reloaded.Assembler/Assembler.cs index e084834..baa86e7 100644 --- a/Source/Reloaded.Assembler/Assembler.cs +++ b/Source/Reloaded.Assembler/Assembler.cs @@ -92,7 +92,14 @@ public Assembler(int textSize = 0x10000, int resultSize = 0x8000) _getVersionFunction = Marshal.GetDelegateForFunctionPointer(getVersionAddress); } - + /// + /// Destroys this instance of the class. + /// + ~Assembler() + { + Dispose(); + } + /// /// Retrieves the version of the internally used FASM assembler DLL. /// diff --git a/Source/Reloaded.Assembler/Reloaded.Assembler.csproj b/Source/Reloaded.Assembler/Reloaded.Assembler.csproj index be28141..69229b4 100644 --- a/Source/Reloaded.Assembler/Reloaded.Assembler.csproj +++ b/Source/Reloaded.Assembler/Reloaded.Assembler.csproj @@ -21,7 +21,7 @@ https://avatars1.githubusercontent.com/u/45473408?s=400&u=b591dd9f053703e87a08ccc56287a9119e9758cb&v=4 git https://github.com/Reloaded-Project/Reloaded.Assembler - 1.0.3 + 1.0.4