diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-07-11 07:59:25 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-07-11 07:59:25 +0000 |
| commit | b5950d9b27f28d4b62f533b4df728e1170aacd62 (patch) | |
| tree | fa82afa998c879a901acf48d761039b098ac1df6 | |
| parent | url-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 |
