diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-11-01 23:49:00 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-11-01 23:49:00 +0000 |
| commit | 8e5d386afc3c62c587d5e05ff111b41bdf421eea (patch) | |
| tree | f1070f990cbefd13f03fc9c19e97cafcd02a1c42 /shm.c | |
| parent | render: last_buf may point to a free:d buffer (diff) | |
shm: add shm_purge()
Destroys *all* buffers associated with the specified cookie.
Diffstat (limited to 'shm.c')
| -rw-r--r-- | shm.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -182,3 +182,20 @@ shm_fini(void) tll_remove(buffers, it); } } + +void +shm_purge(struct wl_shm *shm, unsigned long cookie) +{ + LOG_DBG("cookie=%lx: purging all buffers", cookie); + + /* Purge old buffers associated with this cookie */ + tll_foreach(buffers, it) { + if (it->item.cookie != cookie) + continue; + + assert(!it->item.busy); + + buffer_destroy(&it->item); + tll_remove(buffers, it); + } +} |
