Walk through the list and free each config, and finally free the list
itself. Freeing approx 20KiB of memory, according to valgrind.
Inspired by a similar patch by enpeng xu.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ unsigned i;
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
break;
}
+ for (i = 0; dri2_dpy->driver_configs[i]; i++)
+ free((__DRIconfig *) dri2_dpy->driver_configs[i]);
+ free(dri2_dpy->driver_configs);
free(dri2_dpy);
disp->DriverData = NULL;