diff options
author | nicm <nicm> | 2019-03-15 14:46:58 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-03-15 14:46:58 +0000 |
commit | 85044a634bbcd660ae4b7c9ff4aed7e3891af5d4 (patch) | |
tree | 71e7996ddc5a8ce2b9b9900d858c90770cdb1a02 | |
parent | 2d71bef0ca3d0c31975f70118f632fe30393b059 (diff) | |
download | rtmux-85044a634bbcd660ae4b7c9ff4aed7e3891af5d4.tar.gz rtmux-85044a634bbcd660ae4b7c9ff4aed7e3891af5d4.tar.bz2 rtmux-85044a634bbcd660ae4b7c9ff4aed7e3891af5d4.zip |
Move status line free into its own function.
-rw-r--r-- | server-client.c | 8 | ||||
-rw-r--r-- | status.c | 18 | ||||
-rw-r--r-- | tmux.h | 1 |
3 files changed, 19 insertions, 8 deletions
diff --git a/server-client.c b/server-client.c index ba24034b..b436267d 100644 --- a/server-client.c +++ b/server-client.c @@ -281,13 +281,7 @@ server_client_lost(struct client *c) if (c->stderr_data != c->stdout_data) evbuffer_free(c->stderr_data); - if (event_initialized(&c->status.timer)) - evtimer_del(&c->status.timer); - screen_free(&c->status.status); - if (c->status.old_status != NULL) { - screen_free(c->status.old_status); - free(c->status.old_status); - } + status_free(c); free(c->title); free((void *)c->cwd); @@ -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) { @@ -1970,6 +1970,7 @@ void status_update_saved(struct session *); int status_at_line(struct client *); u_int status_line_size(struct client *); struct window *status_get_window_at(struct client *, u_int); +void status_free(struct client *); int status_redraw(struct client *); void printflike(2, 3) status_message_set(struct client *, const char *, ...); void status_message_clear(struct client *); |