mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 08:33:17 +01:00
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.
This commit is contained in:
parent
842bc2b855
commit
a6d52405a8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user