summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-03-18 21:55:04 +0000
committernicm <nicm@openbsd.org>2019-03-18 21:55:04 +0000
commitd680d99b21c76d2fe836abb1eba8d282261f8ed3 (patch)
treefcbb631ceea9d4676daf63e9c43d957159769900
parentThe individual -fg, -bg and -attr options have been deprecated (in (diff)
downloadwireguard-openbsd-d680d99b21c76d2fe836abb1eba8d282261f8ed3.tar.xz
wireguard-openbsd-d680d99b21c76d2fe836abb1eba8d282261f8ed3.zip
Free temporary screens when writing format.
-rw-r--r--usr.bin/tmux/format-draw.c10
-rw-r--r--usr.bin/tmux/window.c4
2 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/tmux/format-draw.c b/usr.bin/tmux/format-draw.c
index aec73fa7b84..845ce1afeb2 100644
--- a/usr.bin/tmux/format-draw.c
+++ b/usr.bin/tmux/format-draw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format-draw.c,v 1.1 2019/03/18 20:53:33 nicm Exp $ */
+/* $OpenBSD: format-draw.c,v 1.2 2019/03/18 21:55:04 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -694,8 +694,10 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
}
free(fr);
- for (i = 0; i < TOTAL; i++)
+ for (i = 0; i < TOTAL; i++) {
+ screen_write_stop(&ctx[i]);
log_debug("%s: width %s is %u", __func__, names[i], width[i]);
+ }
if (focus_start != -1 && focus_end != -1)
log_debug("focus is %d-%d", focus_start, focus_end);
TAILQ_FOREACH(fr, &frs, entry) {
@@ -748,6 +750,10 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
format_free_range(&frs, fr);
}
+ /* Free the screens. */
+ for (i = 0; i < TOTAL; i++)
+ screen_free(&s[i]);
+
/* Restore the original cursor position. */
screen_write_cursormove(octx, ocx, ocy, 0);
}
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index f0c0f98b716..42b36e8240c 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.224 2019/03/18 20:53:33 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.225 2019/03/18 21:55:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -864,6 +864,8 @@ window_pane_destroy(struct window_pane *wp)
input_free(wp);
+ screen_free(&wp->status_screen);
+
screen_free(&wp->base);
if (wp->saved_grid != NULL)
grid_destroy(wp->saved_grid);