summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Engestrom <eric@engestrom.ch>2018-10-19 14:25:36 +0000
committerEric Engestrom <eric@engestrom.ch>2018-10-19 14:25:36 +0000
commit00412f84952411fa108dd6ddf1118b429322eda7 (patch)
treea6422bfd7adaa63a34b3c6c29ce430468c1f2c11
parent732cd1b8f65c125e157292d340c487008db7dfb7 (diff)
parente5411250da60dd3f2b96871a05f90780b5adca10 (diff)
Merge branch 'fd_close' into 'master'
cube-tex: close the fd after EGLImage creation. See merge request mesa/kmscube!2
-rw-r--r--cube-tex.c5
1 files changed, 5 insertions, 0 deletions
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;
}