Fix CoreRT build breaks
authorJan Kotas <jkotas@microsoft.com>
Wed, 11 Apr 2018 14:13:34 +0000 (07:13 -0700)
committerStephen Toub <stoub@microsoft.com>
Wed, 11 Apr 2018 18:40:14 +0000 (14:40 -0400)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
src/mscorlib/shared/System/Gen2GcCallback.cs
src/mscorlib/shared/System/Runtime/ConstrainedExecution/CriticalFinalizerObject.cs

index 904fde7..2252681 100644 (file)
@@ -67,7 +67,7 @@ namespace System
             }
 
             // Resurrect ourselves by re-registering for finalization.
-            if (!Environment.HasShutdownStarted && !AppDomain.CurrentDomain.IsFinalizingForUnload())
+            if (!Environment.HasShutdownStarted)
             {
                 GC.ReRegisterForFinalize(this);
             }
index cbb9562..3f35f81 100644 (file)
@@ -2,22 +2,16 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-//
 /*============================================================
 **
 **
-**
 ** Deriving from this class will cause any finalizer you define to be critical
 ** (i.e. the finalizer is guaranteed to run, won't be aborted by the host and is
 ** run after the finalizers of other objects collected at the same time).
 **
-**
 ** 
 ===========================================================*/
 
-using System;
-using System.Runtime.InteropServices;
-
 namespace System.Runtime.ConstrainedExecution
 {
     public abstract class CriticalFinalizerObject
@@ -26,6 +20,7 @@ namespace System.Runtime.ConstrainedExecution
         {
         }
 
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1821:RemoveEmptyFinalizers")]
         ~CriticalFinalizerObject()
         {
         }