forked from enlightenment/efl
wayland_shm: Fix fd leak in dmabuf
Need to close the fd from PrimeHandleToFD.
This commit is contained in:
parent
b32e1ace46
commit
da6b03540f
|
@ -484,6 +484,7 @@ _evas_dmabuf_buffer_destroy(Dmabuf_Buffer *b)
|
|||
b->surface = NULL;
|
||||
return;
|
||||
}
|
||||
if (b->fd != -1) close(b->fd);
|
||||
/* The buffer manager may have been destroyed already if we're
|
||||
* doing fallback */
|
||||
if (buffer_manager) buffer_manager->discard(b);
|
||||
|
@ -644,6 +645,7 @@ _evas_dmabuf_buffer_init(Dmabuf_Surface *s, int w, int h)
|
|||
out = calloc(1, sizeof(Dmabuf_Buffer));
|
||||
if (!out) return NULL;
|
||||
|
||||
out->fd = -1;
|
||||
out->surface = s;
|
||||
out->bh = bm->alloc(bm, "name", w, h, &out->stride, &out->fd);
|
||||
if (!out->bh)
|
||||
|
|
Loading…
Reference in New Issue