diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-06-05 18:18:33 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2015-06-05 18:18:33 +0000 |
commit | e960f51033addb582b022c1b61fe0a2cf2961fa0 (patch) | |
tree | d23ba585c2d7731996d806ca2d2e2be0869c7079 /usr.bin/tmux/server.c | |
parent | 31b58ac51774606a1ca75eae0fa5461d6263cc1c (diff) |
Similarly, for sessions use a callback to free rather than checking
every loop.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r-- | usr.bin/tmux/server.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index 4f157fdc175..9e63221e816 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.127 2015/06/05 18:01:12 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.128 2015/06/05 18:18:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -58,7 +58,6 @@ int server_create_socket(void); void server_loop(void); int server_should_shutdown(void); void server_send_shutdown(void); -void server_clean_dead(void); void server_accept_callback(int, short, void *); void server_signal_callback(int, short, void *); void server_child_signal(void); @@ -204,7 +203,6 @@ server_start(int lockfd, char *lockfile) RB_INIT(&all_window_panes); TAILQ_INIT(&clients); RB_INIT(&sessions); - RB_INIT(&dead_sessions); TAILQ_INIT(&session_groups); mode_key_init_trees(); key_bindings_init(); @@ -264,8 +262,6 @@ server_loop(void) server_window_loop(); server_client_loop(); - - server_clean_dead(); } } @@ -317,21 +313,6 @@ server_send_shutdown(void) session_destroy(s); } -/* Free dead, unreferenced clients and sessions. */ -void -server_clean_dead(void) -{ - struct session *s, *s1; - - RB_FOREACH_SAFE(s, sessions, &dead_sessions, s1) { - if (s->references != 0) - continue; - RB_REMOVE(sessions, &dead_sessions, s); - free(s->name); - free(s); - } -} - /* Update socket execute permissions based on whether sessions are attached. */ void server_update_socket(void) |