mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-10-19 06:58:56 +08:00
Dont handle sessiosn events if object being disposed
This commit is contained in:
@@ -487,11 +487,19 @@ namespace Renci.SshNet.Channels
|
||||
|
||||
private void Session_Disconnected(object sender, EventArgs e)
|
||||
{
|
||||
// If objected is disposed or being disposed don't handle this event
|
||||
if (this._isDisposed)
|
||||
return;
|
||||
|
||||
this._disconnectedWaitHandle.Set();
|
||||
}
|
||||
|
||||
private void Session_ErrorOccured(object sender, ExceptionEventArgs e)
|
||||
{
|
||||
// If objected is disposed or being disposed don't handle this event
|
||||
if (this._isDisposed)
|
||||
return;
|
||||
|
||||
this._errorOccuredWaitHandle.Set();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user