1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Make sure we do notify_remote_exit(ssh->frontend) _before_

connection_fatal(), since the latter is entitled to destroy the
backend so `ssh' may no longer be valid once it returns.

For the Unix port, switch exit(0) to gtk_main_quit() in
notify_remote_exit(), so that we don't exit before the subsequent
connection_fatal()!

[originally from svn r5445]
This commit is contained in:
Simon Tatham 2005-03-05 17:56:28 +00:00
parent 7b22e5b2ab
commit f76c35b4b7
2 changed files with 4 additions and 3 deletions

5
ssh.c
View File

@ -2517,6 +2517,9 @@ static int ssh_closing(Plug plug, const char *error_msg, int error_code,
error_msg = "Server unexpectedly closed network connection"; error_msg = "Server unexpectedly closed network connection";
} }
if (need_notify)
notify_remote_exit(ssh->frontend);
if (error_msg) { if (error_msg) {
/* A socket error has occurred. */ /* A socket error has occurred. */
logevent(error_msg); logevent(error_msg);
@ -2524,8 +2527,6 @@ static int ssh_closing(Plug plug, const char *error_msg, int error_code,
} else { } else {
logevent("Server closed network connection"); logevent("Server closed network connection");
} }
if (need_notify)
notify_remote_exit(ssh->frontend);
return 0; return 0;
} }

View File

@ -1169,7 +1169,7 @@ void notify_remote_exit(void *frontend)
inst->exited = TRUE; inst->exited = TRUE;
if (inst->cfg.close_on_exit == FORCE_ON || if (inst->cfg.close_on_exit == FORCE_ON ||
(inst->cfg.close_on_exit == AUTO && exitcode == 0)) (inst->cfg.close_on_exit == AUTO && exitcode == 0))
exit(0); /* just go. */ gtk_main_quit(); /* just go */
if (inst->ldisc) { if (inst->ldisc) {
ldisc_free(inst->ldisc); ldisc_free(inst->ldisc);
inst->ldisc = NULL; inst->ldisc = NULL;