aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-07-11 07:59:25 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-07-11 07:59:25 +0000
commitb5950d9b27f28d4b62f533b4df728e1170aacd62 (patch)
treefa82afa998c879a901acf48d761039b098ac1df6
parenturl-mode: purge SHM pixmaps when destroying URLs (diff)
wayland: purge CSD pixmaps when destroying the CSDs
CSDs aren’t typically toggled on and off. Thus, when disabled, immediately purge their corresponding pixmap buffers, to free up some memory, and release file descriptors.
-rw-r--r--wayland.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/wayland.c b/wayland.c
index ecc4f31e..bea6fb52 100644
--- a/wayland.c
+++ b/wayland.c
@@ -51,8 +51,13 @@ csd_instantiate(struct wl_window *win)
static void
csd_destroy(struct wl_window *win)
{
- for (size_t i = 0; i < ALEN(win->csd.surface); i++)
+ struct terminal *term = win->term;
+ struct wl_shm *shm = term->wl->shm;
+
+ for (size_t i = 0; i < ALEN(win->csd.surface); i++) {
wayl_win_subsurface_destroy(&win->csd.surface[i]);
+ shm_purge(shm, shm_cookie_csd(term, i));
+ }
}
static void