Skip to content

Commit b2d95d2

Browse files
committed
Dereference _channel first.
1 parent 800fd3f commit b2d95d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Renci.SshNet/SubsystemSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ public void Disconnect()
131131
var channel = _channel;
132132
if (channel != null)
133133
{
134+
_channel = null;
134135
channel.DataReceived -= Channel_DataReceived;
135136
channel.Exception -= Channel_Exception;
136137
channel.Closed -= Channel_Closed;
137138
channel.Dispose();
138-
_channel = null;
139139
}
140140
}
141141

0 commit comments

Comments
 (0)