fix: adds ssh dispose for the client

This commit is contained in:
Jason Alborough
2022-10-07 11:11:23 -04:00
parent 095e6c8d79
commit f7317832a1

View File

@@ -290,6 +290,7 @@ namespace PepperDash.Core
/// </summary>
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");