aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/shm.c b/shm.c
index ed20af3a..00804400 100644
--- a/shm.c
+++ b/shm.c
@@ -156,7 +156,6 @@ page_size(void)
static bool
instantiate_offset(struct wl_shm *shm, struct buffer *buf, off_t new_offset)
{
- xassert(buf->fd >= 0);
xassert(buf->mmapped == NULL);
xassert(buf->wl_buf == NULL);
xassert(buf->pix == NULL);
@@ -417,6 +416,12 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie,
}
#endif
+ if (!shm_can_scroll(ret)) {
+ /* We only need to keep the pool FD open if we’re going to SHM
+ * scroll it */
+ close(pool_fd);
+ }
+
return ret;
err: