diff --git a/src/Renci.SshNet/BaseClient.cs b/src/Renci.SshNet/BaseClient.cs index bf728abc0..6879e1349 100644 --- a/src/Renci.SshNet/BaseClient.cs +++ b/src/Renci.SshNet/BaseClient.cs @@ -461,14 +461,6 @@ protected void CheckDisposed() #endif // NET7_0_OR_GREATER } - /// - /// Finalizes an instance of the class. - /// - ~BaseClient() - { - Dispose(disposing: false); - } - /// /// Stops the keep-alive timer, and waits until all timer callbacks have been /// executed. diff --git a/src/Renci.SshNet/Channels/Channel.cs b/src/Renci.SshNet/Channels/Channel.cs index e1e154ffd..4c0909f26 100644 --- a/src/Renci.SshNet/Channels/Channel.cs +++ b/src/Renci.SshNet/Channels/Channel.cs @@ -868,13 +868,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~Channel() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/Compression/Compressor.cs b/src/Renci.SshNet/Compression/Compressor.cs index 9c643c921..56519b05a 100644 --- a/src/Renci.SshNet/Compression/Compressor.cs +++ b/src/Renci.SshNet/Compression/Compressor.cs @@ -175,14 +175,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Releases unmanaged resources and performs other cleanup operations before the is reclaimed - /// by garbage collection. - /// - ~Compressor() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/ForwardedPortRemote.cs b/src/Renci.SshNet/ForwardedPortRemote.cs index 17a1a569b..97065eb97 100644 --- a/src/Renci.SshNet/ForwardedPortRemote.cs +++ b/src/Renci.SshNet/ForwardedPortRemote.cs @@ -379,13 +379,5 @@ protected override void Dispose(bool disposing) _isDisposed = true; } - - /// - /// Finalizes an instance of the class. - /// - ~ForwardedPortRemote() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/KeyboardInteractiveAuthenticationMethod.cs b/src/Renci.SshNet/KeyboardInteractiveAuthenticationMethod.cs index 55b792a9b..eda8286d4 100644 --- a/src/Renci.SshNet/KeyboardInteractiveAuthenticationMethod.cs +++ b/src/Renci.SshNet/KeyboardInteractiveAuthenticationMethod.cs @@ -183,13 +183,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~KeyboardInteractiveAuthenticationMethod() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/KeyboardInteractiveConnectionInfo.cs b/src/Renci.SshNet/KeyboardInteractiveConnectionInfo.cs index 4828b62b2..0498447aa 100644 --- a/src/Renci.SshNet/KeyboardInteractiveConnectionInfo.cs +++ b/src/Renci.SshNet/KeyboardInteractiveConnectionInfo.cs @@ -174,13 +174,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~KeyboardInteractiveConnectionInfo() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/NoneAuthenticationMethod.cs b/src/Renci.SshNet/NoneAuthenticationMethod.cs index 3969f1b29..f40c537b8 100644 --- a/src/Renci.SshNet/NoneAuthenticationMethod.cs +++ b/src/Renci.SshNet/NoneAuthenticationMethod.cs @@ -121,13 +121,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~NoneAuthenticationMethod() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/PasswordAuthenticationMethod.cs b/src/Renci.SshNet/PasswordAuthenticationMethod.cs index 3a679572d..f080df1ff 100644 --- a/src/Renci.SshNet/PasswordAuthenticationMethod.cs +++ b/src/Renci.SshNet/PasswordAuthenticationMethod.cs @@ -201,13 +201,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~PasswordAuthenticationMethod() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/PasswordConnectionInfo.cs b/src/Renci.SshNet/PasswordConnectionInfo.cs index 8953a0c29..dc27393a0 100644 --- a/src/Renci.SshNet/PasswordConnectionInfo.cs +++ b/src/Renci.SshNet/PasswordConnectionInfo.cs @@ -291,13 +291,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~PasswordConnectionInfo() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/PrivateKeyAuthenticationMethod.cs b/src/Renci.SshNet/PrivateKeyAuthenticationMethod.cs index d71490427..d19e5df7e 100644 --- a/src/Renci.SshNet/PrivateKeyAuthenticationMethod.cs +++ b/src/Renci.SshNet/PrivateKeyAuthenticationMethod.cs @@ -191,14 +191,6 @@ protected virtual void Dispose(bool disposing) } } - /// - /// Finalizes an instance of the class. - /// - ~PrivateKeyAuthenticationMethod() - { - Dispose(disposing: false); - } - private sealed class SignatureData : SshData { private readonly RequestMessagePublicKey _message; diff --git a/src/Renci.SshNet/PrivateKeyConnectionInfo.cs b/src/Renci.SshNet/PrivateKeyConnectionInfo.cs index dacfc36b1..86d50a2fd 100644 --- a/src/Renci.SshNet/PrivateKeyConnectionInfo.cs +++ b/src/Renci.SshNet/PrivateKeyConnectionInfo.cs @@ -170,13 +170,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~PrivateKeyConnectionInfo() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/PrivateKeyFile.cs b/src/Renci.SshNet/PrivateKeyFile.cs index 93848c095..fbfd65408 100644 --- a/src/Renci.SshNet/PrivateKeyFile.cs +++ b/src/Renci.SshNet/PrivateKeyFile.cs @@ -669,14 +669,6 @@ protected virtual void Dispose(bool disposing) } } - /// - /// Finalizes an instance of the class. - /// - ~PrivateKeyFile() - { - Dispose(disposing: false); - } - private sealed class SshDataReader : SshData { public SshDataReader(byte[] data) diff --git a/src/Renci.SshNet/Security/Cryptography/ED25519DigitalSignature.cs b/src/Renci.SshNet/Security/Cryptography/ED25519DigitalSignature.cs index 41cfe1f74..afd71d31d 100644 --- a/src/Renci.SshNet/Security/Cryptography/ED25519DigitalSignature.cs +++ b/src/Renci.SshNet/Security/Cryptography/ED25519DigitalSignature.cs @@ -83,13 +83,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~ED25519DigitalSignature() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/Security/Cryptography/ED25519Key.cs b/src/Renci.SshNet/Security/Cryptography/ED25519Key.cs index 7f31ac887..75da41674 100644 --- a/src/Renci.SshNet/Security/Cryptography/ED25519Key.cs +++ b/src/Renci.SshNet/Security/Cryptography/ED25519Key.cs @@ -131,13 +131,5 @@ protected virtual void Dispose(bool disposing) _isDisposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~ED25519Key() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/Security/KeyExchange.cs b/src/Renci.SshNet/Security/KeyExchange.cs index d87b5f083..f5c3d5c7f 100644 --- a/src/Renci.SshNet/Security/KeyExchange.cs +++ b/src/Renci.SshNet/Security/KeyExchange.cs @@ -564,15 +564,6 @@ protected virtual void Dispose(bool disposing) { } - /// - /// Releases unmanaged resources and performs other cleanup operations before the - /// is reclaimed by garbage collection. - /// - ~KeyExchange() - { - Dispose(disposing: false); - } - #endregion } } diff --git a/src/Renci.SshNet/Session.cs b/src/Renci.SshNet/Session.cs index 0dbd03738..19bee9d67 100644 --- a/src/Renci.SshNet/Session.cs +++ b/src/Renci.SshNet/Session.cs @@ -2253,14 +2253,6 @@ protected virtual void Dispose(bool disposing) } } - /// - /// Finalizes an instance of the class. - /// - ~Session() - { - Dispose(disposing: false); - } - /// /// Gets the connection info. /// diff --git a/src/Renci.SshNet/Sftp/SftpFileReader.cs b/src/Renci.SshNet/Sftp/SftpFileReader.cs index f47a941d9..651d8f61f 100644 --- a/src/Renci.SshNet/Sftp/SftpFileReader.cs +++ b/src/Renci.SshNet/Sftp/SftpFileReader.cs @@ -219,11 +219,6 @@ public byte[] Read() return read; } - ~SftpFileReader() - { - Dispose(disposing: false); - } - public void Dispose() { Dispose(disposing: true); diff --git a/src/Renci.SshNet/Sftp/SftpFileStream.cs b/src/Renci.SshNet/Sftp/SftpFileStream.cs index 8bf0f864a..54aee6901 100644 --- a/src/Renci.SshNet/Sftp/SftpFileStream.cs +++ b/src/Renci.SshNet/Sftp/SftpFileStream.cs @@ -439,14 +439,6 @@ internal static async Task OpenAsync(ISftpSession session, strin return new SftpFileStream(session, path, access, bufferSize, handle, position); } - /// - /// Finalizes an instance of the class. - /// - ~SftpFileStream() - { - Dispose(disposing: false); - } - /// /// Clears all buffers for this stream and causes any buffered data to be written to the file. /// diff --git a/src/Renci.SshNet/Shell.cs b/src/Renci.SshNet/Shell.cs index 2afe9eb43..c38cac83c 100644 --- a/src/Renci.SshNet/Shell.cs +++ b/src/Renci.SshNet/Shell.cs @@ -350,13 +350,5 @@ protected virtual void Dispose(bool disposing) _disposed = true; } } - - /// - /// Finalizes an instance of the class. - /// - ~Shell() - { - Dispose(disposing: false); - } } } diff --git a/src/Renci.SshNet/SubsystemSession.cs b/src/Renci.SshNet/SubsystemSession.cs index 70385d903..f37497c86 100644 --- a/src/Renci.SshNet/SubsystemSession.cs +++ b/src/Renci.SshNet/SubsystemSession.cs @@ -537,14 +537,6 @@ protected virtual void Dispose(bool disposing) } } - /// - /// Finalizes an instance of the class. - /// - ~SubsystemSession() - { - Dispose(disposing: false); - } - private void EnsureNotDisposed() { #if NET7_0_OR_GREATER