CoreRT-specific Object.cs changes - Fix build breaks - Apply same cleanup to all...
authorJan Kotas <jkotas@microsoft.com>
Sat, 22 Dec 2018 03:59:46 +0000 (19:59 -0800)
committerJan Kotas <jkotas@microsoft.com>
Sat, 22 Dec 2018 06:48:49 +0000 (22:48 -0800)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
src/System.Private.CoreLib/shared/System/Object.cs

index 8d875fc..3319b2d 100644 (file)
@@ -22,6 +22,14 @@ namespace System
         {
         }
 
+        // Allow an object to free resources before the object is reclaimed by the GC.
+        // This method's virtual slot number is hardcoded in runtimes. Do not add any virtual methods ahead of this.
+        [NonVersionable]
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1821:RemoveEmptyFinalizers")]
+        ~Object()
+        {
+        }
+
         // Returns a String which represents the object instance.  The default
         // for an object is to return the fully qualified name of the class.
         public virtual string ToString()
@@ -69,11 +77,5 @@ namespace System
         {
             return RuntimeHelpers.GetHashCode(this);
         }
-
-        // Allow an object to free resources before the object is reclaimed by the GC.
-        [NonVersionable]
-        ~Object()
-        {
-        }
     }
 }