From 29d7de4014207f14dd4c5df77af2515ce769c501 Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Mon, 23 Nov 2020 18:07:43 +0000 Subject: [PATCH] Remove incorrectly implemented finalizer Don't use finalizer to dispose of managed resources. --- .../utils/CryptoUtils.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/System.Management.Automation/utils/CryptoUtils.cs b/src/System.Management.Automation/utils/CryptoUtils.cs index c75acdf1aff..96877437da2 100644 --- a/src/System.Management.Automation/utils/CryptoUtils.cs +++ b/src/System.Management.Automation/utils/CryptoUtils.cs @@ -627,18 +627,6 @@ protected void Dispose(bool disposing) } } - /// - /// Destructor. - /// - ~PSRSACryptoServiceProvider() - { - // When Dispose() is called, GC.SuppressFinalize() - // is called and therefore this finalizer will not - // be invoked. Hence this is run only on process - // shutdown - Dispose(true); - } - #endregion IDisposable }