summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-03-15 14:46:59 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-03-15 14:46:59 +0000
commit4711b04cea85e201f1ddcc67d6950778ffa8839e (patch)
treeb5729f60b0f95f30bc5cb0fe278dd272be88217a /usr.bin/tmux/status.c
parent0b567e5153bca9368653da00f2c9e2a4c1a76af9 (diff)
Move status line free into its own function.
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r--usr.bin/tmux/status.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index fb860d5ecfa..459149599ce 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.185 2019/03/14 23:14:27 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.186 2019/03/15 14:46:58 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -296,7 +296,23 @@ status_get_window_at(struct client *c, u_int x)
return (NULL);
}
-/* Draw status for client on the last lines of given context. */
+/* Free status line. */
+void
+status_free(struct client *c)
+{
+ struct status_line *sl = &c->status;
+
+ if (event_initialized(&sl->timer))
+ evtimer_del(&sl->timer);
+
+ screen_free(&sl->status);
+ if (sl->old_status != NULL) {
+ screen_free(sl->old_status);
+ free(sl->old_status);
+ }
+}
+
+/* Draw status line for client. */
int
status_redraw(struct client *c)
{