From b9ade6e6bb54538dd1164e3a16d261b6580ba4a9 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sat, 23 Jan 2010 21:07:31 +0000 Subject: [PATCH] When a window is destroyed, remove all links to it from each session rather than just the first. Reported by Robin Lee Powell. --- server-fn.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server-fn.c b/server-fn.c index ce5e518d..3c7277bd 100644 --- a/server-fn.c +++ b/server-fn.c @@ -260,13 +260,13 @@ server_kill_window(struct window *w) s = ARRAY_ITEM(&sessions, i); if (s == NULL || !session_has(s, w)) continue; - if ((wl = winlink_find_by_window(&s->windows, w)) == NULL) - continue; - - if (session_detach(s, wl)) - server_destroy_session_group(s); - else - server_redraw_session_group(s); + while ((wl = winlink_find_by_window(&s->windows, w)) != NULL) { + if (session_detach(s, wl)) { + server_destroy_session_group(s); + break; + } else + server_redraw_session_group(s); + } } }