summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-04-16 22:27:50 +0200
committerDylan Baker <dylan@pnwbakers.com>2016-10-07 13:21:19 -0700
commitfc838d5faded5ca0225769d5cfcd978dba546e12 (patch)
treefb76dd8b2a38328d92d86fe33e8286b0e31718ec
parentb300e1f58dc1f8c783b12d09baff7e9233d33408 (diff)
util: guard against double context destruction
this no longer crashes: - create context (calls atexit) - teardown context - create context 2 (calls atexit) - exit()
-rw-r--r--tests/util/piglit-framework-gl.c4
1 files changed, 4 insertions, 0 deletions
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