Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ dotnet_diagnostic.SA1641.severity = none
dotnet_diagnostic.SA1642.severity = none

# SA1643: Destructor summary documentation should begin with standard text
dotnet_diagnostic.SA1643.severity = none
dotnet_diagnostic.SA1643.severity = warning

# SA1648: inheritdoc should be used with inheriting class
dotnet_diagnostic.SA1648.severity = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void Dispose()
}

/// <summary>
/// Finalizer.
/// Finalizes an instance of the <see cref="PropVariant"/> class.
/// </summary>
~PropVariant()
{
Expand Down
16 changes: 8 additions & 8 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,14 +1194,6 @@ private void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArg
ui.WriteLine();
}

/// <summary>
/// Finalizes the instance.
/// </summary>
~ConsoleHost()
{
Dispose(false);
}

/// <summary>
/// Disposes of this instance, per the IDisposable pattern.
/// </summary>
Expand Down Expand Up @@ -1260,6 +1252,14 @@ private void Dispose(bool isDisposingNotFinalizing)
_isDisposed = true;
}

/// <summary>
/// Finalizes an instance of the <see cref="ConsoleHost"/> class.
/// </summary>
~ConsoleHost()
{
Dispose(false);
}

/// <summary>
/// Indicates if the session should be terminated or not. Typically set by the break handler for Close, Logoff, and
/// Shutdown events. Note that the only valid transition for this property is from false to true: it is not legal to
Expand Down
8 changes: 8 additions & 0 deletions src/System.Management.Automation/engine/EventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,14 @@ public void Dispose(bool disposing)
}
}
}

/// <summary>
/// Finalizes an instance of the <see cref="PSLocalEventManager"/> class.
/// </summary>
~PSLocalEventManager()
{
Dispose(false);
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ public void Dispose()
}

/// <summary>
/// Ensure we release the worker thread.
/// Finalizes an instance of the <see cref="PipelineThread"/> class.
/// </summary>
~PipelineThread()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ internal virtual void PrepareForConnect()
#region Clean up

/// <summary>
/// Finalizer.
/// Finalizes an instance of the <see cref="BaseClientTransportManager"/> class.
/// </summary>
~BaseClientTransportManager()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,18 +687,6 @@ internal WSManData_ManToUn(string data)
Marshal.StructureToPtr(_internalData, _marshalledObject, false);
}

/// <summary>
/// Finalizer
///
/// Note: Do not depend on the finalizer! This object should be
/// properly disposed of when no longer needed via a direct call
/// to Dispose().
/// </summary>
~WSManData_ManToUn()
{
Dispose(false);
}

/// <summary>
/// Gets the type of data.
/// </summary>
Expand Down Expand Up @@ -747,6 +735,14 @@ private void Dispose(bool isDisposing)
}
}

/// <summary>
/// Finalizes an instance of the <see cref="WSManData_ManToUn"/> class.
/// </summary>
~WSManData_ManToUn()
{
Dispose(false);
}

/// <summary>
/// Implicit IntPtr conversion.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,7 @@ private void Dispose(bool disposing)
}

/// <summary>
/// Use C# destructor syntax for finalization code.
/// This destructor will run only if the Dispose method
/// does not get called.
/// It gives your base class the opportunity to finalize.
/// Do not provide destructors in types derived from this class.
/// Finalizes an instance of the <see cref="WSManPluginEntryDelegates"/> class.
/// </summary>
~WSManPluginEntryDelegates()
{
Expand Down Expand Up @@ -766,11 +762,7 @@ private void Dispose(bool disposing)
}

/// <summary>
/// Use C# destructor syntax for finalization code.
/// This destructor will run only if the Dispose method
/// does not get called.
/// It gives your base class the opportunity to finalize.
/// Do not provide destructors in types derived from this class.
/// Finalizes an instance of the <see cref="WSManPluginManagedEntryInstanceWrapper"/> class.
/// </summary>
~WSManPluginManagedEntryInstanceWrapper()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ protected virtual void Dispose(bool disposing)
}

/// <summary>
/// Use C# destructor syntax for finalization code.
/// This destructor will run only if the Dispose method
/// does not get called.
/// It gives your base class the opportunity to finalize.
/// Do not provide destructors in types derived from this class.
/// Finalizes an instance of the <see cref="WSManPluginServerSession"/> class.
/// </summary>
~WSManPluginServerSession()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected override void Dispose(bool disposing)
}

/// <summary>
/// Finalizer to ensure destruction of unmanaged resources.
/// Finalizes an instance of the <see cref="CabinetExtractor"/> class.
/// </summary>
~CabinetExtractor()
{
Expand Down