summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/format-draw.c
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 /usr.bin/tmux/format-draw.c
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.
Diffstat (limited to 'usr.bin/tmux/format-draw.c')
-rw-r--r--usr.bin/tmux/format-draw.c10
1 files changed, 8 insertions, 2 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);
}