[Mesa-dev] [PATCH 02/14] egl: Tear down images and syncs at eglTerminate

Adam Jackson ajax at redhat.com
Mon Sep 12 22:19:40 UTC 2016


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 src/egl/main/egldisplay.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index bbc3063..3d4eb81 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -44,6 +44,8 @@
 #include "egldriver.h"
 #include "eglglobals.h"
 #include "egllog.h"
+#include "eglimage.h"
+#include "eglsync.h"
 
 /* Includes for _eglNativePlatformDetectNativeDisplay */
 #ifdef HAVE_MINCORE
@@ -300,6 +302,26 @@ _eglReleaseDisplayResources(_EGLDriver *drv, _EGLDisplay *display)
       drv->API.DestroySurface(drv, display, surf);
    }
    assert(!display->ResourceLists[_EGL_RESOURCE_SURFACE]);
+
+   list = display->ResourceLists[_EGL_RESOURCE_IMAGE];
+   while (list) {
+      _EGLImage *image = (_EGLImage *) list;
+      list = list->Next;
+
+      _eglUnlinkImage(image);
+      drv->API.DestroyImageKHR(drv, display, image);
+   }
+   assert(!display->ResourceLists[_EGL_RESOURCE_IMAGE]);
+
+   list = display->ResourceLists[_EGL_RESOURCE_SYNC];
+   while (list) {
+      _EGLSync *sync = (_EGLSync *) list;
+      list = list->Next;
+
+      _eglUnlinkSync(sync);
+      drv->API.DestroySyncKHR(drv, display, sync);
+   }
+   assert(!display->ResourceLists[_EGL_RESOURCE_SYNC]);
 }
 
 
-- 
2.9.3



More information about the mesa-dev mailing list