diff options
author | nicm <nicm> | 2019-06-30 19:21:53 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-06-30 19:21:53 +0000 |
commit | cf30e0f9357b7e42491645a87eeae06ffb8e8066 (patch) | |
tree | 8de07a8bf70e47a91a3e5e23bf5c1426a4c3b70c | |
parent | 4ff7bc3eb32e9d66312d16757fb8c083df2d87d6 (diff) | |
download | rtmux-cf30e0f9357b7e42491645a87eeae06ffb8e8066.tar.gz rtmux-cf30e0f9357b7e42491645a87eeae06ffb8e8066.tar.bz2 rtmux-cf30e0f9357b7e42491645a87eeae06ffb8e8066.zip |
Do not double free window if pane fails to start.
-rw-r--r-- | spawn.c | 4 | ||||
-rw-r--r-- | tmux.h | 1 | ||||
-rw-r--r-- | window.c | 2 |
3 files changed, 2 insertions, 5 deletions
@@ -172,10 +172,8 @@ spawn_window(struct spawn_context *sc, char **cause) /* Spawn the pane. */ wp = spawn_pane(sc, cause); if (wp == NULL) { - if (~sc->flags & SPAWN_RESPAWN) { - window_destroy(w); + if (~sc->flags & SPAWN_RESPAWN) winlink_remove(&s->windows, sc->wl); - } return (NULL); } @@ -2362,7 +2362,6 @@ struct window *window_find_by_id_str(const char *); struct window *window_find_by_id(u_int); void window_update_activity(struct window *); struct window *window_create(u_int, u_int); -void window_destroy(struct window *); void window_pane_set_event(struct window_pane *); struct window_pane *window_get_active_at(struct window *, u_int, u_int); struct window_pane *window_find_string(struct window *, const char *); @@ -338,7 +338,7 @@ window_create(u_int sx, u_int sy) return (w); } -void +static void window_destroy(struct window *w) { log_debug("window @%u destroyed (%d references)", w->id, w->references); |