From 8d5872699f8a4ce5c062c5f7c1e01f3a4d31817f Mon Sep 17 00:00:00 2001 From: Juan Lin <9691057+juanlin@users.noreply.github.com> Date: Sat, 21 Oct 2017 22:47:08 +0800 Subject: Fix crash on telnet quit, connection cleanup --- Clovershell/ShellConnection.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Clovershell/ShellConnection.cs b/Clovershell/ShellConnection.cs index acbcb42e..ff97a5ec 100644 --- a/Clovershell/ShellConnection.cs +++ b/Clovershell/ShellConnection.cs @@ -89,10 +89,11 @@ namespace com.clusterrr.clovershell finally { shellConnectionThread = null; + Debug.WriteLine(string.Format("Shell client {0} disconnected", id)); + if (socket != null) + socket.Close(); + connection.shellConnections[id] = null; } - Debug.WriteLine(string.Format("Shell client {0} disconnected", id)); - socket.Close(); - connection.shellConnections[id] = null; } public void Dispose() -- cgit v1.2.3