aboutsummaryrefslogtreecommitdiff
path: root/shm.c
diff options
context:
space:
mode:
Diffstat (limited to 'shm.c')
-rw-r--r--shm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/shm.c b/shm.c
index 6785cbfb..f58ca3e4 100644
--- a/shm.c
+++ b/shm.c
@@ -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);
+ }
+}