Skip to content

Commit 15e4e8a

Browse files
authored
Remove unnecessary finalizers (#14248)
1 parent c7bdb24 commit 15e4e8a

File tree

8 files changed

+0
-64
lines changed

8 files changed

+0
-64
lines changed

src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,6 @@ public void Dispose()
705705
GC.SuppressFinalize(this);
706706
}
707707

708-
/// <summary>
709-
/// Finalizer.
710-
/// </summary>
711-
~ContentCommandBase()
712-
{
713-
Dispose(false);
714-
}
715708
#endregion IDisposable
716-
717709
}
718710
}

src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,5 @@ public void Dispose()
492492
this.Dispose(true);
493493
GC.SuppressFinalize(this);
494494
}
495-
496-
/// <summary>
497-
/// Finalizer.
498-
/// </summary>
499-
~OutGridViewCommand()
500-
{
501-
Dispose(false);
502-
}
503495
}
504496
}

src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommand.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ public class ShowCommandCommand : PSCmdlet, IDisposable
6363
private object _commandViewModelObj;
6464
#endregion
6565

66-
/// <summary>
67-
/// Finalizes an instance of the ShowCommandCommand class.
68-
/// </summary>
69-
~ShowCommandCommand()
70-
{
71-
this.Dispose(false);
72-
}
73-
7466
#region Input Cmdlet Parameter
7567
/// <summary>
7668
/// Gets or sets the command name.

src/Microsoft.PowerShell.Commands.Utility/commands/utility/Tee-Object.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,6 @@ public void Dispose()
149149
GC.SuppressFinalize(this);
150150
}
151151

152-
/// <summary>
153-
/// Finalizer.
154-
/// </summary>
155-
~TeeObjectCommand()
156-
{
157-
Dispose(false);
158-
}
159-
160152
#region private
161153
private CommandWrapper _commandWrapper;
162154
private bool _alreadyDisposed;

src/System.Management.Automation/engine/CommandProcessorBase.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -957,14 +957,6 @@ private void Dispose(bool disposing)
957957
_disposed = true;
958958
}
959959

960-
/// <summary>
961-
/// Finalizer for class CommandProcessorBase.
962-
/// </summary>
963-
~CommandProcessorBase()
964-
{
965-
Dispose(false);
966-
}
967-
968960
#endregion IDispose
969961
}
970962
}

src/System.Management.Automation/engine/EventManager.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,14 +1510,6 @@ protected virtual void OnForwardEvent(PSEventArgs e)
15101510
ForwardEvent?.Invoke(this, e);
15111511
}
15121512

1513-
/// <summary>
1514-
/// Destructor for the EventManager class.
1515-
/// </summary>
1516-
~PSLocalEventManager()
1517-
{
1518-
Dispose(false);
1519-
}
1520-
15211513
/// <summary>
15221514
/// Disposes the EventManager class.
15231515
/// </summary>

src/System.Management.Automation/engine/lang/scriptblock.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,14 +1313,6 @@ private void Dispose(bool disposing)
13131313
_disposed = true;
13141314
}
13151315

1316-
/// <summary>
1317-
/// Finalizer for class SteppablePipeline.
1318-
/// </summary>
1319-
~SteppablePipeline()
1320-
{
1321-
Dispose(false);
1322-
}
1323-
13241316
#endregion IDispose
13251317
}
13261318

src/System.Management.Automation/engine/pipeline.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ private void Dispose(bool disposing)
9191
_disposed = true;
9292
}
9393

94-
/// <summary>
95-
/// Finalizer for class PipelineProcessor.
96-
/// </summary>
97-
~PipelineProcessor()
98-
{
99-
Dispose(false);
100-
}
101-
10294
#endregion IDispose
10395

10496
#region Execution Logging

0 commit comments

Comments
 (0)