diff --git a/CHANGELOG.md b/CHANGELOG.md index 30a73369..30b3e1e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,8 +77,11 @@ * Wrong documented default value for `initial-color-theme` in `foot.ini(5)` ([#2292][2292]). +* Occasional crashes when closing a window and + `tweak.pre-apply-damage=yes` (the default) ([#2288][2288]). [2292]: https://codeberg.org/dnkl/foot/issues/2292 +[2288]: https://codeberg.org/dnkl/foot/issues/2288 ### Security diff --git a/wayland.c b/wayland.c index 1d258213..1ffd62a6 100644 --- a/wayland.c +++ b/wayland.c @@ -2177,8 +2177,6 @@ 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); @@ -2236,6 +2234,8 @@ wayl_win_destroy(struct wl_window *win) tll_remove(win->urls, it); } + render_wait_for_preapply_damage(term); + csd_destroy(win); wayl_win_subsurface_destroy(&win->search); wayl_win_subsurface_destroy(&win->scrollback_indicator);