mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 21:30:09 +01:00
glx: don't destroy context immediately if it's currently bound
According to the GLXDestroyContext() man page, the context should not immediately be destroyed if it's bound to some thread. Wait until it's unbound to really delete it. The code for doing the later part is already present in MakeContextCurrent() so no change was needed there.
This commit is contained in:
parent
4837e01bcd
commit
5e6a6a2719
1 changed files with 10 additions and 0 deletions
|
|
@ -540,6 +540,16 @@ DestroyContext(Display * dpy, GLXContext gc)
|
|||
imported = gc->imported;
|
||||
gc->xid = None;
|
||||
|
||||
if (gc->currentDpy) {
|
||||
/* This context is bound to some thread. According to the man page,
|
||||
* we should not actually delete the context until it's unbound.
|
||||
* Note that we set gc->xid = None above. In MakeContextCurrent()
|
||||
* we check for that and delete the context there.
|
||||
*/
|
||||
__glXUnlock();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
/* Destroy the direct rendering context */
|
||||
if (gc->driContext) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue