From fc838d5faded5ca0225769d5cfcd978dba546e12 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 16 Apr 2016 22:27:50 +0200 Subject: util: guard against double context destruction this no longer crashes: - create context (calls atexit) - teardown context - create context 2 (calls atexit) - exit() --- tests/util/piglit-framework-gl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c index 1c25f2caa..001b23a1d 100644 --- a/tests/util/piglit-framework-gl.c +++ b/tests/util/piglit-framework-gl.c @@ -177,8 +177,12 @@ piglit_gl_process_args(int *argc, char *argv[], static void destroy(void) { + if (!gl_fw) + return; + if (gl_fw->destroy) gl_fw->destroy(gl_fw); + gl_fw = NULL; } void -- cgit v1.2.3