mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
glx: Only remove the glx_display from the list after it's destroyed.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
(cherry picked from commit a26121f375)
This commit is contained in:
parent
43ad25baa7
commit
db17691e28
1 changed files with 8 additions and 3 deletions
|
|
@ -260,19 +260,24 @@ glx_display_free(struct glx_display *priv)
|
|||
static int
|
||||
__glXCloseDisplay(Display * dpy, XExtCodes * codes)
|
||||
{
|
||||
struct glx_display *priv, **prev;
|
||||
struct glx_display *priv, **prev, *next;
|
||||
|
||||
_XLockMutex(_Xglobal_lock);
|
||||
prev = &glx_displays;
|
||||
for (priv = glx_displays; priv; prev = &priv->next, priv = priv->next) {
|
||||
if (priv->dpy == dpy) {
|
||||
(*prev) = priv->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
_XUnlockMutex(_Xglobal_lock);
|
||||
|
||||
/* Only remove the display from the list after it's destroyed. The cleanup
|
||||
* code (e.g. driReleaseDrawables()) ends up calling __glXInitialize(),
|
||||
* which would create a new glx_display while we're trying to destroy this
|
||||
* one. */
|
||||
next = priv->next;
|
||||
glx_display_free(priv);
|
||||
*prev = next;
|
||||
_XUnlockMutex(_Xglobal_lock);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue