From e5411250da60dd3f2b96871a05f90780b5adca10 Mon Sep 17 00:00:00 2001 From: Dongseong Hwang Date: Mon, 13 Aug 2018 17:26:18 -0700 Subject: cube-tex: close the fd after EGLImage creation. EGLImage takes the fd ownership. --- cube-tex.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cube-tex.c b/cube-tex.c index 09f18e3..c74c183 100644 --- a/cube-tex.c +++ b/cube-tex.c @@ -363,6 +363,7 @@ static int init_tex_rgba(void) egl->glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img); egl->eglDestroyImageKHR(egl->display, img); + close(fd); return 0; } @@ -429,6 +430,7 @@ static int init_tex_nv12_2img(void) egl->glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img_y); egl->eglDestroyImageKHR(egl->display, img_y); + close(fd_y); /* UV plane texture: */ img_uv = egl->eglCreateImageKHR(egl->display, EGL_NO_CONTEXT, @@ -443,6 +445,7 @@ static int init_tex_nv12_2img(void) egl->glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img_uv); egl->eglDestroyImageKHR(egl->display, img_uv); + close(fd_uv); return 0; } @@ -499,6 +502,8 @@ static int init_tex_nv12_1img(void) egl->glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img); egl->eglDestroyImageKHR(egl->display, img); + close(fd_y); + close(fd_uv); return 0; } -- cgit v1.2.3