Sync OpenBSD patchset 1014:

Call bufferevent_free before closing file descriptor associated with it
or bugs in $EventMechanism on $OtherOS makes libevent get it's knickers
in a twist. From Dylan Alex Simon.
This commit is contained in:
Tiago Cunha
2012-01-29 12:53:33 +00:00
parent 9c1d3046ca
commit e23df3af5a
4 changed files with 12 additions and 12 deletions

View File

@ -608,8 +608,8 @@ window_pane_destroy(struct window_pane *wp)
window_pane_reset_mode(wp);
if (wp->fd != -1) {
close(wp->fd);
bufferevent_free(wp->event);
close(wp->fd);
}
input_free(wp);
@ -619,8 +619,8 @@ window_pane_destroy(struct window_pane *wp)
grid_destroy(wp->saved_grid);
if (wp->pipe_fd != -1) {
close(wp->pipe_fd);
bufferevent_free(wp->pipe_event);
close(wp->pipe_fd);
}
RB_REMOVE(window_pane_tree, &all_window_panes, wp);
@ -644,8 +644,8 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
struct termios tio2;
if (wp->fd != -1) {
close(wp->fd);
bufferevent_free(wp->event);
close(wp->fd);
}
if (cmd != NULL) {
if (wp->cmd != NULL)