diff options
author | nicm <nicm> | 2021-09-27 19:12:00 +0000 |
---|---|---|
committer | nicm <nicm> | 2021-09-27 19:12:00 +0000 |
commit | 68c890585991c1114690d43a179eef0a7f207871 (patch) | |
tree | 7f501387876ec7675a2f0baee1c77d28bb2c7237 /server-client.c | |
parent | 257e9ba69a06c37c3b970db06c50e93f91955b11 (diff) | |
download | rtmux-68c890585991c1114690d43a179eef0a7f207871.tar.gz rtmux-68c890585991c1114690d43a179eef0a7f207871.tar.bz2 rtmux-68c890585991c1114690d43a179eef0a7f207871.zip |
Do not call recalculate_sizes while clearing a client session because it
needs to loop over the clients, instead do it after all clients are
cleared. Fixes a crash reported by martijn@ when a session with multiple
clients attached is destroyed, but there are other sessions so tmux does
not entirely exit. ok deraadt
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server-client.c b/server-client.c index a7cad0a5..51988799 100644 --- a/server-client.c +++ b/server-client.c @@ -321,11 +321,11 @@ server_client_set_session(struct client *c, struct session *s) c->last_session = NULL; c->session = s; c->flags |= CLIENT_FOCUSED; - recalculate_sizes(); if (old != NULL && old->curw != NULL) window_update_focus(old->curw->window); if (s != NULL) { + recalculate_sizes(); window_update_focus(s->curw->window); session_update_activity(s, NULL); gettimeofday(&s->last_attached_time, NULL); @@ -2057,6 +2057,7 @@ server_client_dispatch(struct imsg *imsg, void *arg) if (datalen != 0) fatalx("bad MSG_EXITING size"); server_client_set_session(c, NULL); + recalculate_sizes(); tty_close(&c->tty); proc_send(c->peer, MSG_EXITED, -1, NULL, 0); break; |