If remain-on-exit is set, both the error callback and a SIGCHLD could

destroy the same pane (because the first one doesn't remove it from the
list of panes), causing the pane bufferevent to be freed twice. So don't
free it if the fd has already been set to -1, from Romain Francoise.
pull/1/head
Nicholas Marriott 2010-04-17 23:25:16 +00:00
parent 842bc2b855
commit a6d52405a8
1 changed files with 5 additions and 3 deletions

View File

@ -325,9 +325,11 @@ server_destroy_pane(struct window_pane *wp)
{
struct window *w = wp->window;
close(wp->fd);
bufferevent_free(wp->event);
wp->fd = -1;
if (wp->fd != -1) {
close(wp->fd);
bufferevent_free(wp->event);
wp->fd = -1;
}
if (options_get_number(&w->options, "remain-on-exit"))
return;