diff --git a/Hardware/ATI/ADL.cs b/Hardware/ATI/ADL.cs index 52e1bff..48931d0 100644 --- a/Hardware/ATI/ADL.cs +++ b/Hardware/ATI/ADL.cs @@ -267,9 +267,11 @@ namespace OpenHardwareMonitor.Hardware.ATI { private delegate IntPtr ADL_Main_Memory_AllocDelegate(int size); - private static IntPtr Main_Memory_Alloc(int size) { - return Marshal.AllocHGlobal(size);; - } + // create a Main_Memory_Alloc delegate and keep it alive + private static ADL_Main_Memory_AllocDelegate Main_Memory_Alloc = + delegate(int size) { + return Marshal.AllocHGlobal(size); + }; private static void Main_Memory_Free(IntPtr buffer) { if (IntPtr.Zero != buffer)