From dfd9159a53ffb06e770c613e596b857cde52bd0b Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 5 May 2016 11:48:42 -0500 Subject: [PATCH] wayland_shm: Fix dmabuf failed allocation handling We frequently attempt to generate multiple buffers before any come back as failed - the orphaned buffers need to be handled more carefully. --- src/modules/evas/engines/wayland_shm/evas_dmabuf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c index df1611498e..ee31a233b2 100644 --- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c @@ -197,12 +197,14 @@ static void _create_failed(void *data, struct zwp_linux_buffer_params_v1 *params) { Dmabuf_Buffer *b = data; + Eina_Bool orphaned; zwp_linux_buffer_params_v1_destroy(params); dmabuf_totally_hosed = EINA_TRUE; - _evas_dmabuf_buffer_destroy(b); + orphaned = b->orphaned; _allocation_complete(b); + if (orphaned) _evas_dmabuf_buffer_destroy(b); } static const struct zwp_linux_buffer_params_v1_listener params_listener =