When a window is destroyed, remove all links to it from each session rather

than just the first. Reported by Robin Lee Powell.
This commit is contained in:
Nicholas Marriott 2010-01-23 21:07:31 +00:00
parent c0d3e4315c
commit b9ade6e6bb

View File

@ -260,15 +260,15 @@ 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))
while ((wl = winlink_find_by_window(&s->windows, w)) != NULL) {
if (session_detach(s, wl)) {
server_destroy_session_group(s);
else
break;
} else
server_redraw_session_group(s);
}
}
}
int
server_link_window(struct session *src, struct winlink *srcwl,