From 5b61869a24a4dd9e85204855bab4ea1e0a5c7b75 Mon Sep 17 00:00:00 2001
From: xtqqczze <45661989+xtqqczze@users.noreply.github.com>
Date: Tue, 13 Feb 2024 17:08:43 +0000
Subject: [PATCH] Seal `ClientRemoteSessionDSHandlerImpl`
The motivation of this PR is this comment by @PaulHigin https://github.com/PowerShell/PowerShell/pull/11820#discussion_r452405592_.
_Contributes to #15110._
---
.../client/remotingprotocolimplementation.cs | 20 +++----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs b/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs
index 71720f6cacd..eb65cd219db 100644
--- a/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs
+++ b/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs
@@ -13,7 +13,7 @@ namespace System.Management.Automation.Remoting
///
/// Implements ServerRemoteSessionDataStructureHandler.
///
- internal class ClientRemoteSessionDSHandlerImpl : ClientRemoteSessionDataStructureHandler, IDisposable
+ internal sealed class ClientRemoteSessionDSHandlerImpl : ClientRemoteSessionDataStructureHandler, IDisposable
{
[TraceSourceAttribute("CRSDSHdlerImpl", "ClientRemoteSessionDSHandlerImpl")]
private static readonly PSTraceSource s_trace = PSTraceSource.GetTracer("CRSDSHdlerImpl", "ClientRemoteSessionDSHandlerImpl");
@@ -735,26 +735,12 @@ internal void ProcessNonSessionMessages(RemoteDataObject rcvdData)
#region IDisposable
- ///
- /// Public method for dispose.
- ///
- public void Dispose()
- {
- Dispose(true);
-
- GC.SuppressFinalize(this);
- }
-
///
/// Release all resources.
///
- /// If true, release all managed resources.
- protected void Dispose(bool disposing)
+ public void Dispose()
{
- if (disposing)
- {
- _transportManager.Dispose();
- }
+ _transportManager.Dispose();
}
#endregion IDisposable