mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
mesa/glthread: don't set a dispatch table if we aren't the owner
Fix crashes when glxMakeCurrent is called. Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Timothy Arceri <tarceri@itsqueeze.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Tested-by: Mike Lothian <mike@fireburn.co.uk>
This commit is contained in:
parent
012bfebc07
commit
70e715eea6
1 changed files with 10 additions and 3 deletions
|
|
@ -173,9 +173,16 @@ _mesa_glthread_destroy(struct gl_context *ctx)
|
|||
free(glthread);
|
||||
ctx->GLThread = NULL;
|
||||
|
||||
/* Remove ourselves from the dispatch table. */
|
||||
ctx->CurrentClientDispatch = ctx->CurrentServerDispatch;
|
||||
_glapi_set_dispatch(ctx->CurrentClientDispatch);
|
||||
/* 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.
|
||||
*/
|
||||
if (_glapi_get_dispatch() == ctx->MarshalExec) {
|
||||
ctx->CurrentClientDispatch = ctx->CurrentServerDispatch;
|
||||
_glapi_set_dispatch(ctx->CurrentClientDispatch);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue