summaryrefslogtreecommitdiffstats
path: root/control.c
diff options
context:
space:
mode:
authornicm <nicm>2020-06-01 21:08:05 +0000
committernicm <nicm>2020-06-01 21:08:05 +0000
commit563b7331da2d31aca470389817c282a46da7c872 (patch)
tree946b6bec547cd0689e73f00b93423ad6f1ff7ceb /control.c
parent8339702d4779794de0fcb85dd620421ae5cf768b (diff)
Remove blocks from queue when pane disappears.
Diffstat (limited to 'control.c')
-rw-r--r--control.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/control.c b/control.c
index c1e0b7eb..94254d7c 100644
--- a/control.c
+++ b/control.c
@@ -48,7 +48,7 @@ struct control_block {
TAILQ_ENTRY(control_block) entry;
TAILQ_ENTRY(control_block) all_entry;
- };
+};
/* Control client pane. */
struct control_pane {
@@ -455,8 +455,10 @@ control_write_pending(struct client *c, struct control_pane *cp, size_t limit)
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);
}