Destroy panes immediately rather than checking them all every loop.

This commit is contained in:
Nicholas Marriott
2009-11-13 17:33:07 +00:00
parent 1415eb3dd2
commit 8e47966225
6 changed files with 26 additions and 69 deletions

View File

@ -316,6 +316,27 @@ server_unlink_window(struct session *s, struct winlink *wl)
server_redraw_session_group(s);
}
void
server_destroy_pane(struct window_pane *wp)
{
struct window *w = wp->window;
close(wp->fd);
bufferevent_free(wp->event);
wp->fd = -1;
if (options_get_number(&w->options, "remain-on-exit"))
return;
layout_close_pane(wp);
window_remove_pane(w, wp);
if (TAILQ_EMPTY(&w->panes))
server_kill_window(w);
else
server_redraw_window(w);
}
void
server_destroy_session_group(struct session *s)
{