# HG changeset patch # User reimar # Date 1370772788 0 # Node ID fc128e175f727ed5aff652052fed286d941e27e3 # Parent d05b680f78d68adeea114f7a6fdce1115c90d213 Fully uninitialize EGL. Unfortunately that doesn't seem to help against the insane number of memory leaks reported inside MESA EGL by valgrind. diff -r d05b680f78d6 -r fc128e175f72 libvo/gl_common.c --- a/libvo/gl_common.c Sun Jun 09 10:09:41 2013 +0000 +++ b/libvo/gl_common.c Sun Jun 09 10:13:08 2013 +0000 @@ -2561,13 +2561,18 @@ */ static void releaseGlContext_egl(MPGLContext *ctx) { EGLContext *context = &ctx->context.egl; - if (*context != EGL_NO_CONTEXT) - { + if (*context != EGL_NO_CONTEXT) { mpglFinish(); eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroyContext(eglDisplay, *context); } *context = EGL_NO_CONTEXT; + if (eglSurface != EGL_NO_SURFACE) + eglDestroySurface(eglDisplay, eglSurface); + eglSurface = EGL_NO_SURFACE; + if (eglDisplay != EGL_NO_DISPLAY) + eglTerminate(eglDisplay); + eglDisplay = EGL_NO_DISPLAY; } static void swapGlBuffers_egl(MPGLContext *ctx) {