mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 10:08:47 +00:00
Use RB_FOREACH_SAFE as winlinks are being removed, from Chris Johnsen.
This commit is contained in:
parent
226f9fa012
commit
63d109fb7f
@ -40,14 +40,14 @@ int
|
|||||||
cmd_kill_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
cmd_kill_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||||
{
|
{
|
||||||
struct args *args = self->args;
|
struct args *args = self->args;
|
||||||
struct winlink *wl, *wl2;
|
struct winlink *wl, *wl2, *wl3;
|
||||||
struct session *s;
|
struct session *s;
|
||||||
|
|
||||||
if ((wl = cmd_find_window(ctx, args_get(args, 't'), &s)) == NULL)
|
if ((wl = cmd_find_window(ctx, args_get(args, 't'), &s)) == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
if (args_has(args, 'a')) {
|
if (args_has(args, 'a')) {
|
||||||
RB_FOREACH(wl2, winlinks, &s->windows) {
|
RB_FOREACH_SAFE(wl2, winlinks, &s->windows, wl3) {
|
||||||
if (wl != wl2)
|
if (wl != wl2)
|
||||||
server_kill_window(wl2->window);
|
server_kill_window(wl2->window);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user