Fully disconnect when remote server ends connection. (#24)

* Fully disconnect when remote server ends connection.

When the remote server ends the connection, the message `(disconnected by server)` is presented, but ssheven is not in a state that is
ready to start a new connection. This change prevents the user from having to select
File>Disconnect before selecting File>Connect.. for a new session.

* Remove extra quotation mark from comment
This commit is contained in:
invariablyafk 2024-10-26 15:33:44 -07:00 committed by GitHub
parent 3d72dc084e
commit ad0e5aff54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}