[vlc-commits] egl: explicitly destroy the context

Thomas Guillem git at videolan.org
Fri Jul 20 10:34:23 CEST 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul 20 10:29:26 2018 +0200| [c014f068244ca12a33ecd0f59665d842e26218c4] | committer: Thomas Guillem

egl: explicitly destroy the context

The eglTerminate() documentation state that any contexts and surfaces
associated with the display are marked for deletion.

But this doesn't seem to be the case on Android with a GLES2 context.

(cherry picked from commit f5a766e3699f19f3a37f6331e62bdc5de0e7fd04)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=c014f068244ca12a33ecd0f59665d842e26218c4
---

 modules/video_output/opengl/egl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/video_output/opengl/egl.c b/modules/video_output/opengl/egl.c
index 9162675447..10277c5045 100644
--- a/modules/video_output/opengl/egl.c
+++ b/modules/video_output/opengl/egl.c
@@ -204,6 +204,8 @@ static void Close (vlc_object_t *obj)
 
     if (sys->display != EGL_NO_DISPLAY)
     {
+        if (sys->context != EGL_NO_CONTEXT)
+            eglDestroyContext(sys->display, sys->context);
         if (sys->surface != EGL_NO_SURFACE)
             eglDestroySurface(sys->display, sys->surface);
         eglTerminate(sys->display);



More information about the vlc-commits mailing list