wayland: explicitly purge all SHM pixmaps when destroying window

All SHM pixmap cookies depend on the terminal instance’s memory
address. Thus, after a terminal instance has been destroyed, shm
pixmaps that belonged to it will never be purged automatically.
This commit is contained in:
Daniel Eklöf 2021-07-11 10:01:22 +02:00
parent b5950d9b27
commit a9872aac5a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1475,6 +1475,14 @@ wayl_win_destroy(struct wl_window *win)
wayl_win_subsurface_destroy(&win->scrollback_indicator);
wayl_win_subsurface_destroy(&win->render_timer);
shm_purge(shm, shm_cookie_search(term));
shm_purge(shm, shm_cookie_scrollback_indicator(term));
shm_purge(shm, shm_cookie_render_timer(term));
shm_purge(shm, shm_cookie_grid(term));
for (size_t i = 0; i < ALEN(win->csd.surface); i++)
shm_purge(shm, shm_cookie_csd(term, i));
#if defined(HAVE_XDG_ACTIVATION)
if (win->xdg_activation_token != NULL)
xdg_activation_token_v1_destroy(win->xdg_activation_token);