[corlib] change Mono.SafeGPtrArrayHandle to a struct
[mono.git] / mcs / class / corlib / Mono / SafeGPtrArrayHandle.cs
index 133af690678aa0653db6ba86be4cd8f6c802d606..0441c9b8bd8b9dcbafdf7cd95c222c97558d32b3 100644 (file)
@@ -13,7 +13,7 @@ using System;
 using System.Runtime.CompilerServices;
 
 namespace Mono {
-       internal sealed class SafeGPtrArrayHandle : IDisposable {
+       internal struct SafeGPtrArrayHandle : IDisposable {
                RuntimeGPtrArrayHandle handle;
 
                internal SafeGPtrArrayHandle (IntPtr ptr)
@@ -21,19 +21,8 @@ namespace Mono {
                        handle = new RuntimeGPtrArrayHandle (ptr);
                }
 
-               ~SafeGPtrArrayHandle ()
-               {
-                       Dispose (false);
-               }
-
-               void Dispose (bool disposing)
-               {
-                       RuntimeGPtrArrayHandle.DestroyAndFree (ref handle);
-               }
-
                public void Dispose () {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
+                       RuntimeGPtrArrayHandle.DestroyAndFree (ref handle);
                }
 
                internal int Length {