diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2018-07-31 11:10:17 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2018-08-21 14:20:33 +0100 |
commit | 17412f0fe9eec4b475e0c38a8e64759fd725c3c2 (patch) | |
tree | 1dd58a3be05f8bc1ee8b2e4743a05247e827dc18 /tests/egl/spec | |
parent | 1b502660b9bfb59ddf0aaaffbfc2e6160b62c610 (diff) |
egl_ext_device_query: plug memory leaks
Call eglTerminate, otherwise we'll end up with massive leaks reported in
Valgrind. Fairly useful when checking if the EGL implementation is
leak-free.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Diffstat (limited to 'tests/egl/spec')
-rw-r--r-- | tests/egl/spec/egl_ext_device_query/egl_ext_device_query.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/egl/spec/egl_ext_device_query/egl_ext_device_query.c b/tests/egl/spec/egl_ext_device_query/egl_ext_device_query.c index a6f5fa815..5887d1e02 100644 --- a/tests/egl/spec/egl_ext_device_query/egl_ext_device_query.c +++ b/tests/egl/spec/egl_ext_device_query/egl_ext_device_query.c @@ -77,37 +77,49 @@ main(void) } queryDisplayAttrib(dpy, 0xbad1dea, (EGLAttrib *)&device); - if (!piglit_check_egl_error(EGL_BAD_ATTRIBUTE)) + if (!piglit_check_egl_error(EGL_BAD_ATTRIBUTE)) { + eglTerminate(dpy); piglit_report_result(PIGLIT_FAIL); + } if (!queryDisplayAttrib(dpy, EGL_DEVICE_EXT, (EGLAttrib *)&device)) { printf("Failed to query display\n"); + eglTerminate(dpy); piglit_report_result(PIGLIT_FAIL); } if (device == EGL_NO_DEVICE_EXT) { printf("Got no device handle\n"); + eglTerminate(dpy); piglit_report_result(PIGLIT_FAIL); } queryDeviceAttrib(device, 0xbad1dea, &attr); - if (!piglit_check_egl_error(EGL_BAD_ATTRIBUTE)) + if (!piglit_check_egl_error(EGL_BAD_ATTRIBUTE)) { + eglTerminate(dpy); piglit_report_result(PIGLIT_FAIL); + } devstring = queryDeviceString(device, 0xbad1dea); - if (!piglit_check_egl_error(EGL_BAD_PARAMETER)) + if (!piglit_check_egl_error(EGL_BAD_PARAMETER)) { + eglTerminate(dpy); piglit_report_result(PIGLIT_FAIL); + } devstring = queryDeviceString(EGL_NO_DEVICE_EXT, EGL_EXTENSIONS); - if (!piglit_check_egl_error(EGL_BAD_DEVICE_EXT)) + if (!piglit_check_egl_error(EGL_BAD_DEVICE_EXT)) { + eglTerminate(dpy); piglit_report_result(PIGLIT_FAIL); + } devstring = queryDeviceString(device, EGL_EXTENSIONS); if (devstring == NULL) { printf("Empty device extension string\n"); + eglTerminate(dpy); piglit_report_result(PIGLIT_WARN); } + eglTerminate(dpy); printf("Device extension string: %s\n", devstring); piglit_report_result(PIGLIT_PASS); } |