Make glx destroy path handle cases where the X window goes away first.
This commit is contained in:
parent
242f56f722
commit
30bcaa966d
|
@ -185,10 +185,14 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
|
||||||
|
|
||||||
(*private->driDrawable.destroyDrawable)(&private->driDrawable);
|
(*private->driDrawable.destroyDrawable)(&private->driDrawable);
|
||||||
|
|
||||||
__glXenterServer(GL_FALSE);
|
/* If the X window was destroyed, the dri DestroyWindow hook will
|
||||||
DRIDestroyDrawable(drawable->pDraw->pScreen,
|
* aready have taken care of this, so only call if pDraw isn't NULL. */
|
||||||
serverClient, drawable->pDraw);
|
if (drawable->pDraw != NULL) {
|
||||||
__glXleaveServer(GL_FALSE);
|
__glXenterServer(GL_FALSE);
|
||||||
|
DRIDestroyDrawable(drawable->pDraw->pScreen,
|
||||||
|
serverClient, drawable->pDraw);
|
||||||
|
__glXleaveServer(GL_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
xfree(private);
|
xfree(private);
|
||||||
}
|
}
|
||||||
|
@ -668,11 +672,16 @@ getDrawableInfo(__DRIdrawable *driDrawable,
|
||||||
{
|
{
|
||||||
__GLXDRIdrawable *drawable = containerOf(driDrawable,
|
__GLXDRIdrawable *drawable = containerOf(driDrawable,
|
||||||
__GLXDRIdrawable, driDrawable);
|
__GLXDRIdrawable, driDrawable);
|
||||||
ScreenPtr pScreen = drawable->base.pDraw->pScreen;
|
ScreenPtr pScreen;
|
||||||
drm_clip_rect_t *pClipRects, *pBackClipRects;
|
drm_clip_rect_t *pClipRects, *pBackClipRects;
|
||||||
GLboolean retval;
|
GLboolean retval;
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
||||||
|
/* If the X window has been destroyed, give up here. */
|
||||||
|
if (drawable->base.pDraw == NULL)
|
||||||
|
return GL_FALSE;
|
||||||
|
|
||||||
|
pScreen = drawable->base.pDraw->pScreen;
|
||||||
__glXenterServer(GL_FALSE);
|
__glXenterServer(GL_FALSE);
|
||||||
retval = DRIGetDrawableInfo(pScreen, drawable->base.pDraw, index, stamp,
|
retval = DRIGetDrawableInfo(pScreen, drawable->base.pDraw, index, stamp,
|
||||||
x, y, width, height,
|
x, y, width, height,
|
||||||
|
|
|
@ -122,6 +122,8 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
|
||||||
cx->pendingState |= __GLX_PENDING_DESTROY;
|
cx->pendingState |= __GLX_PENDING_DESTROY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glxPriv->pDraw = NULL;
|
||||||
|
glxPriv->drawId = 0;
|
||||||
__glXUnrefDrawable(glxPriv);
|
__glXUnrefDrawable(glxPriv);
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
|
|
Loading…
Reference in New Issue