derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=925be86f9e4093aa3fc5d27819951dc55c3faa04

commit 925be86f9e4093aa3fc5d27819951dc55c3faa04
Author: Derek Foreman <[email protected]>
Date:   Thu Nov 16 13:16:19 2017 -0600

    ecore_wl2: Fix dmabuf test failure
    
    We need to destroy the buffer manager on fail, since it will exist but
    only be able to create buffers we can't actually use.
---
 src/lib/ecore_wl2/ecore_wl2_buffer.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_buffer.c 
b/src/lib/ecore_wl2/ecore_wl2_buffer.c
index 9363c1be9c..08a6df007a 100644
--- a/src/lib/ecore_wl2/ecore_wl2_buffer.c
+++ b/src/lib/ecore_wl2/ecore_wl2_buffer.c
@@ -456,7 +456,6 @@ _buffer_manager_deref(void)
    if (drm_fd >=0) close(drm_fd);
 }
 
-/* Currently no callers, but that will change...
 static void
 _buffer_manager_destroy(void)
 {
@@ -464,7 +463,6 @@ _buffer_manager_destroy(void)
    buffer_manager->destroyed = EINA_TRUE;
    _buffer_manager_deref();
 }
-*/
 
 static Buffer_Handle *
 _buffer_manager_alloc(const char *name, int w, int h, unsigned long *stride, 
int32_t *fd)
@@ -585,6 +583,8 @@ _create_failed(void *data, struct 
zwp_linux_buffer_params_v1 *params)
    Ecore_Wl2_Display *ewd = data;
 
    zwp_linux_buffer_params_v1_destroy(params);
+   _buffer_manager_deref();
+   _buffer_manager_destroy();
    ewd->wl.dmabuf = NULL;
 }
 
@@ -614,5 +614,6 @@ _ecore_wl2_buffer_test(Ecore_Wl2_Display *ewd)
 
   return;
 fail:
+  _buffer_manager_destroy();
   ewd->wl.dmabuf = NULL;
 }

-- 


Reply via email to