Clear stale pane references correctly when respawning windows, GitHub

issue 5757 from Alejandro Pacheco.
This commit is contained in:
nicm
2026-10-16 14:26:08 +00:00
committed by tmux update bot
parent cef0dd19a8
commit 98691297e1
3 changed files with 33 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: screen-redraw.c,v 1.169 2026/10/16 07:59:06 nicm Exp $ */
/* $OpenBSD: screen-redraw.c,v 1.170 2026/10/16 14:26:08 nicm Exp $ */
/*
* Copyright (c) 2026 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1096,11 +1096,17 @@ redraw_client_has_window(struct client *c, struct window *w)
return (c->redraw_scene != NULL && c->redraw_scene->w == w);
}
/* Mark a window's cached redraw scenes as out of date. */
/*
* Mark a window's cached redraw scenes as out of date. Generations are unique
* across all windows so a scene can never match a new window that reuses the
* address of a freed one.
*/
void
redraw_invalidate_scene(struct window *w)
{
w->redraw_scene_generation++;
static uint64_t next_generation;
w->redraw_scene_generation = ++next_generation;
}
/* Free all pending damage for a window. */