Fixed a problem where the ADL Main_Memory_Alloc callback delegate could be garbage collected while still in use.
1.1 --- a/Hardware/ATI/ADL.cs Fri Sep 24 21:33:55 2010 +0000
1.2 +++ b/Hardware/ATI/ADL.cs Mon Sep 27 23:48:41 2010 +0000
1.3 @@ -267,9 +267,11 @@
1.4
1.5 private delegate IntPtr ADL_Main_Memory_AllocDelegate(int size);
1.6
1.7 - private static IntPtr Main_Memory_Alloc(int size) {
1.8 - return Marshal.AllocHGlobal(size);;
1.9 - }
1.10 + // create a Main_Memory_Alloc delegate and keep it alive
1.11 + private static ADL_Main_Memory_AllocDelegate Main_Memory_Alloc =
1.12 + delegate(int size) {
1.13 + return Marshal.AllocHGlobal(size);
1.14 + };
1.15
1.16 private static void Main_Memory_Free(IntPtr buffer) {
1.17 if (IntPtr.Zero != buffer)