From c291194a4e593bbbb91420e81fa0111508084448 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 28 Jan 2026 09:44:57 +0100 Subject: wayland: wait for pre-apply damage thread before destroying a terminal instance It's possible, but unlikely, that we've pushed a "pre-apply damage" job to the renderer thread queue (or that we've pushed it, and the a thread is now working on it) when we shutdown a terminal instance. This is sometimes caught in an assertion in term_destroy(), where we check the queue length is 0. Other times, or in release builds, we might crash in the thread, or in the shutdown logic when freeing the buffer chains associated with the terminal instance. Fix by ensuring there's no pre-apply damage operation queued, or running, before shutting down a terminal instance. Closes #2263 --- wayland.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'wayland.c') diff --git a/wayland.c b/wayland.c index 958e535d..59df991a 100644 --- a/wayland.c +++ b/wayland.c @@ -2129,6 +2129,8 @@ wayl_win_destroy(struct wl_window *win) struct terminal *term = win->term; + render_wait_for_preapply_damage(term); + if (win->csd.move_timeout_fd != -1) close(win->csd.move_timeout_fd); -- cgit v1.3