From f7317832a171568d1e6d9001885549045373ba04 Mon Sep 17 00:00:00 2001 From: Jason Alborough Date: Fri, 7 Oct 2022 11:11:23 -0400 Subject: [PATCH] fix: adds ssh dispose for the client --- Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs index 2990ae0..ae38011 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs @@ -290,6 +290,7 @@ namespace PepperDash.Core /// public void Disconnect() { + Debug.Console(2, "Disconnect Called"); ConnectEnabled = false; // Stop trying reconnects, if we are if (ReconnectTimer != null) @@ -307,11 +308,13 @@ namespace PepperDash.Core private void KillClient(SocketStatus status) { KillStream(); - + IsConnecting = false; if (Client != null) { - IsConnecting = false; + Client.ErrorOccurred -= Client_ErrorOccurred; Client.Disconnect(); + Client.Dispose(); + Client = null; ClientStatus = status; Debug.Console(1, this, "Disconnected");