glx: If a destroyed window is bound to the current context, make it not current.

Avoids subsequent crashes due to stale pointers to the DrawableRec, see
https://bugs.freedesktop.org/show_bug.cgi?id=21132#c15 and previous comments.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
This commit is contained in:
Michel Dänzer 2009-05-14 11:46:41 +02:00 committed by Michel Dänzer
parent 2c1190f888
commit 2075d4bf9e

View File

@ -126,6 +126,10 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
__GLXcontext *c;
for (c = glxAllContexts; c; c = c->next) {
if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
(*c->loseCurrent)(c);
__glXFlushContextCache();
}
if (c->drawPriv == glxPriv)
c->drawPriv = NULL;
if (c->readPriv == glxPriv)