Earlier commit failed to attribure that for drm platforms one does not call dri2_create_screen, thus it does not create the screen and driver_configs but inherits them from the "display" - gbm.
As such wrap cleanup in Platform != _EGL_PLATFORM_DRM to prevent the issue and still cleanup correctly for non-drm platforms. Cc: Kenneth Graunke <kenn...@whitecape.org> Cc: Mark Janes <mark.a.ja...@intel.com> Reported-by: Kenneth Graunke <kenn...@whitecape.org> Reported-by: Mark Janes <mark.a.ja...@intel.com> Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> --- src/egl/drivers/dri2/egl_dri2.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index dcc3239..609afde 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -707,9 +707,18 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp) break; } + /* The drm platform does not create the screen/driver_configs but reuses + * the ones from the gbm device. As such the gbm itself is responsible + * for the cleanup. */ +#ifdef HAVE_DRM_PLATFORM + if (disp->Platform != _EGL_PLATFORM_DRM) { +#endif for (i = 0; dri2_dpy->driver_configs[i]; i++) free((__DRIconfig *) dri2_dpy->driver_configs[i]); free(dri2_dpy->driver_configs); +#ifdef HAVE_DRM_PLATFORM + } +#endif free(dri2_dpy); disp->DriverData = NULL; -- 2.1.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev