diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-07-17 13:09:08 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-07-17 13:09:08 +0000 |
commit | 1ed5e20e5647685df9a8d1a789e7f34044763647 (patch) | |
tree | 824dd4b08adcbdcab24602fe882ee1a2fbe9c3c7 /usr.bin/tmux | |
parent | 9eb61a55f420164de54e9934cf9004eb6fb124ae (diff) |
Do not call window_unzoom from window_destroy because it will try to add
a notification which will get confused because the reference count is
already zero and end up back in window_destroy and a double
free. Instead, just destroy the layouts directly. Noticed by Thomas
Adam.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/window.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index bd25c6f827c..e73ea5a16bb 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.134 2015/06/17 16:50:28 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.135 2015/07/17 13:09:07 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -341,12 +341,12 @@ window_create(const char *name, int argc, char **argv, const char *path, void window_destroy(struct window *w) { - window_unzoom(w); - RB_REMOVE(windows, &windows, w); if (w->layout_root != NULL) - layout_free(w); + layout_free_cell(w->layout_root); + if (w->saved_layout_root != NULL) + layout_free_cell(w->saved_layout_root); free(w->old_layout); if (event_initialized(&w->name_timer)) |