mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Tidy some common code for destroying sessions into a new function.
This commit is contained in:
18
server.c
18
server.c
@ -1211,21 +1211,11 @@ server_check_window(struct window *w)
|
||||
RB_FOREACH(wl, winlinks, &s->windows) {
|
||||
if (wl->window != w)
|
||||
continue;
|
||||
destroyed = session_detach(s, wl);
|
||||
for (j = 0; j < ARRAY_LENGTH(&clients); j++) {
|
||||
c = ARRAY_ITEM(&clients, j);
|
||||
if (c == NULL || c->session != s)
|
||||
continue;
|
||||
if (!destroyed) {
|
||||
server_redraw_client(c);
|
||||
continue;
|
||||
}
|
||||
c->session = NULL;
|
||||
server_write_client(c, MSG_EXIT, NULL, 0);
|
||||
}
|
||||
/* If the session was destroyed, bail now. */
|
||||
if (destroyed)
|
||||
if (session_detach(s, wl)) {
|
||||
server_destroy_session(s);
|
||||
break;
|
||||
}
|
||||
server_redraw_session(s);
|
||||
goto restart;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user