Renci.SshNet.SftpClient.Dispose C# (CSharp) Method

Dispose() protected method

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                var sftpSession = _sftpSession;
                if (sftpSession != null)
                {
                    _sftpSession = null;
                    sftpSession.Dispose();
                }
            }
        }
    }

Usage Example

Beispiel #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         _client.Dispose();
     }
 }
All Usage Examples Of Renci.SshNet.SftpClient::Dispose