Răsfoiți Sursa

Removed _ownsHandle field.

Gert Driesen 8 ani în urmă
părinte
comite
8a5d8edb70
1 a modificat fișierele cu 1 adăugiri și 6 ștergeri
  1. 1 6
      src/Renci.SshNet/Sftp/SftpFileStream.cs

+ 1 - 6
src/Renci.SshNet/Sftp/SftpFileStream.cs

@@ -14,7 +14,6 @@ namespace Renci.SshNet.Sftp
         //  TODO:   Add security method to set userid, groupid and other permission settings
         // Internal state.
         private byte[] _handle;
-        private readonly bool _ownsHandle;
         private ISftpSession _session;
 
         // Buffer information.
@@ -189,7 +188,6 @@ namespace Renci.SshNet.Sftp
 
             // Initialize the object state.
             _session = session;
-            _ownsHandle = true;
             _bufferPosition = 0;
             _bufferLen = 0;
             _bufferOwnedByWrite = false;
@@ -717,10 +715,7 @@ namespace Renci.SshNet.Sftp
                                         FlushWriteBuffer();
                                     }
 
-                                    if (_ownsHandle)
-                                    {
-                                        _session.RequestClose(_handle);
-                                    }
+                                    _session.RequestClose(_handle);
                                 }
 
                                 _handle = null;