aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2015-07-17 13:09:07 +0000
committernicm <nicm>2015-07-17 13:09:07 +0000
commitbad8d0fd200c7718a8f51f52b9dd2f23c74d996f (patch)
treede70f6bf5f8086c2c362e7d4f1209c0008b6afa7
parent3192178f15c9bcc88021ceb74189173d562e7694 (diff)
downloadrtmux-bad8d0fd200c7718a8f51f52b9dd2f23c74d996f.tar.gz
rtmux-bad8d0fd200c7718a8f51f52b9dd2f23c74d996f.tar.bz2
rtmux-bad8d0fd200c7718a8f51f52b9dd2f23c74d996f.zip
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.
-rw-r--r--window.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/window.c b/window.c
index 82c10606..6351eff5 100644
--- a/window.c
+++ b/window.c
@@ -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))