st/mesa: call glthread_destroy() before _vbo_DestroyContext()
[mesa.git] / src / mesa / state_tracker / st_context.c
index 869e6e9f87bd60c0f911f4e6f5d120f7f63367cf..c7d25ecd75596d415d19288a0bba9c995476b8c8 100644 (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);