public unsafe void Dispose() { while (_blocks.Count != 0) { MarshalUtil.FreeMemory(_blocks[_blocks.Count - 1].Data); _blocks.RemoveAt(_blocks.Count - 1); } _imports.Clear(); _relocations.Clear(); _blocks.Clear(); _stack.Clear(); }
public void Dispose() { if (InstanceBuffer != IntPtr.Zero) { MarshalUtil.FreeMemory(InstanceBuffer); InstanceBuffer = IntPtr.Zero; } if (RelocationBuffer != IntPtr.Zero) { MarshalUtil.FreeMemory(RelocationBuffer); RelocationBuffer = IntPtr.Zero; } if (ImportsBuffer != IntPtr.Zero) { MarshalUtil.FreeMemory(ImportsBuffer); ImportsBuffer = IntPtr.Zero; } }