diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c index 2d504a0bd97..f5e766adfdb 100644 --- a/src/mesa/main/glthread.c +++ b/src/mesa/main/glthread.c @@ -176,15 +176,10 @@ _mesa_glthread_destroy(struct gl_context *ctx, const char *reason) _mesa_DeleteHashTable(glthread->VAOs); ctx->GLThread.enabled = false; + ctx->CurrentClientDispatch = ctx->CurrentServerDispatch; - /* Remove ourselves from the dispatch table except if another ctx/thread - * already installed a new dispatch table. - * - * Typically glxMakeCurrent will bind a new context (install new table) then - * old context might be deleted. - */ + /* Update the dispatch only if the context is current. */ if (_glapi_get_dispatch() == ctx->MarshalExec) { - ctx->CurrentClientDispatch = ctx->CurrentServerDispatch; _glapi_set_dispatch(ctx->CurrentClientDispatch); } } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 3d62d4be4d2..3473c3aaa86 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -5225,8 +5225,7 @@ struct gl_context struct _glapi_table *ContextLost; /** * Dispatch table used to marshal API calls from the client program to a - * separate server thread. NULL if API calls are not being marshalled to - * another thread. + * separate server thread. */ struct _glapi_table *MarshalExec; /**