st/mesa: call glthread_destroy() before _vbo_DestroyContext()

Otherwise we have a race condition between vbo calls in the
glthread and the _vbo_DestroyContext() call.

This fixes a bunch of piglit crashes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Timothy Arceri
2017-03-16 23:09:19 +11:00
parent 08df015b9d
commit 124ec417f9
2 changed files with 3 additions and 2 deletions
-2
View File
@@ -1294,8 +1294,6 @@ _mesa_free_context_data( struct gl_context *ctx )
_mesa_make_current(ctx, NULL, NULL);
}
_mesa_glthread_destroy(ctx);
/* unreference WinSysDraw/Read buffers */
_mesa_reference_framebuffer(&ctx->WinSysDrawBuffer, NULL);
_mesa_reference_framebuffer(&ctx->WinSysReadBuffer, NULL);
+3
View File
@@ -575,6 +575,9 @@ void st_destroy_context( struct st_context *st )
struct gl_context *ctx = st->ctx;
GLuint i;
/* This must be called first so that glthread has a chance to finish */
_mesa_glthread_destroy(ctx);
_mesa_HashWalk(ctx->Shared->TexObjects, destroy_tex_sampler_cb, st);
st_reference_fragprog(st, &st->fp, NULL);