Mercurial > mplayer.hg
changeset 36214:fc128e175f72
Fully uninitialize EGL.
Unfortunately that doesn't seem to help against the insane number
of memory leaks reported inside MESA EGL by valgrind.
author | reimar |
---|---|
date | Sun, 09 Jun 2013 10:13:08 +0000 |
parents | d05b680f78d6 |
children | 4eb27365d0b0 |
files | libvo/gl_common.c |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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) {