diff --git a/ssheven-net.c b/ssheven-net.c index 7d6b146..6a62f31 100644 --- a/ssheven-net.c +++ b/ssheven-net.c @@ -622,5 +622,12 @@ void* read_thread(void* arg) // disallow pasting after connection is closed DisableItem(menu, 5); + // If the remote server closes the client connection unexpectedly, call disconnect() + // to release memory and avoid the user having to manually select Disconnect and then + // Connect.. from the file menu. + + disconnect(); + + return 0; }