Reset the pointer to the earlier free st_context.
Check the st_context pointer before st_glFlush.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8195
Signed-off-by: Mykola Piatykop <mykola.piatykop@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21656>
curCtx->Const.ContextReleaseBehavior ==
GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH) {
FLUSH_VERTICES(curCtx, 0, 0);
- st_glFlush(curCtx, 0);
+ if (curCtx->st){
+ st_glFlush(curCtx, 0);
+ }
}
if (!newCtx) {
if (st->pipe && destroy_pipe)
st->pipe->destroy(st->pipe);
+ st->ctx->st = NULL;
FREE(st);
}