=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/control.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- src/usr.bin/tmux/control.c 2020/06/01 09:43:01 1.35 +++ src/usr.bin/tmux/control.c 2020/06/01 21:08:05 1.36 @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.35 2020/06/01 09:43:01 nicm Exp $ */ +/* $OpenBSD: control.c,v 1.36 2020/06/01 21:08:05 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott @@ -48,7 +48,7 @@ TAILQ_ENTRY(control_block) entry; TAILQ_ENTRY(control_block) all_entry; - }; +}; /* Control client pane. */ struct control_pane { @@ -455,8 +455,10 @@ if (s == NULL || (wp = window_pane_find_by_id(cp->pane)) == NULL || winlink_find_by_window(&s->windows, wp->window) == NULL) { - TAILQ_FOREACH_SAFE(cb, &cp->blocks, entry, cb1) + TAILQ_FOREACH_SAFE(cb, &cp->blocks, entry, cb1) { + TAILQ_REMOVE(&cp->blocks, cb, entry); control_free_block(cs, cb); + } control_flush_all_blocks(c); return (0); }