EGL: destroy the created EGLSurface on Close()
authorAdrien Maglo <magsoft@videolan.org>
Tue, 5 Nov 2013 08:37:26 +0000 (09:37 +0100)
committerAdrien Maglo <magsoft@videolan.org>
Tue, 5 Nov 2013 08:37:26 +0000 (09:37 +0100)
modules/video_output/egl.c

index be4a17e..58cbece 100644 (file)
@@ -152,6 +152,7 @@ static int Open (vlc_object_t *obj, const struct gl_api *api)
 
     gl->sys = sys;
     sys->display = EGL_NO_DISPLAY;
+    sys->surface = EGL_NO_SURFACE;
 
 #ifdef USE_PLATFORM_X11
     sys->x11 = NULL;
@@ -327,7 +328,11 @@ static void Close (vlc_object_t *obj)
     vlc_gl_sys_t *sys = gl->sys;
 
     if (sys->display != EGL_NO_DISPLAY)
+    {
+        if (sys->surface != EGL_NO_SURFACE)
+            eglDestroySurface(sys->display, sys->surface);
         eglTerminate(sys->display);
+    }
 #ifdef USE_PLATFORM_X11
     if (sys->x11 != NULL)
         XCloseDisplay(sys->x11);