summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-10-23 17:27:01 +0100
committerEmil Velikov <[email protected]>2014-11-06 13:23:51 +0000
commitba0bb4227e5d32619e83765f5967a069766996af (patch)
tree44ba9e3578d1dba1ee119cae5d0778078567f2cb /src/egl
parent54a065d9a62be4d82fb7f4b0af52acea8fd2de73 (diff)
egl_dri2: do not leak dri2_dpy->driver_configs
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 <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 20a72438460..dcc323918eb 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -666,6 +666,7 @@ static EGLBoolean
dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ unsigned i;
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
@@ -706,6 +707,9 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *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;