From cbeebdff0003d3ad65e955fcfed6500777e20276 Mon Sep 17 00:00:00 2001 From: olegkap_cp Date: Tue, 10 May 2011 14:27:08 +0000 Subject: [PATCH] Fix SftpSession.Dispose method --- Renci.SshClient/Renci.SshClient/Sftp/SftpSession.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Renci.SshClient/Renci.SshClient/Sftp/SftpSession.cs b/Renci.SshClient/Renci.SshClient/Sftp/SftpSession.cs index cb4a8634..138a99f3 100644 --- a/Renci.SshClient/Renci.SshClient/Sftp/SftpSession.cs +++ b/Renci.SshClient/Renci.SshClient/Sftp/SftpSession.cs @@ -366,7 +366,8 @@ namespace Renci.SshClient.Sftp { this._channel.DataReceived -= Channel_DataReceived; - this._channel.Close(); + this._channel.Dispose(); + this._channel = null; } this._session.ErrorOccured -= Session_ErrorOccured; @@ -377,11 +378,6 @@ namespace Renci.SshClient.Sftp if (disposing) { // Dispose managed resources. - if (this._channel != null) - { - this._channel.Dispose(); - this._channel = null; - } if (this._errorOccuredWaitHandle != null) { this._errorOccuredWaitHandle.Dispose();