From 2075d4bf9e53b8baef0b919da6c44771220cd4a5 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 14 May 2009 11:46:41 +0200 Subject: glx: If a destroyed window is bound to the current context, make it not current. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- glx/glxext.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glx/glxext.c b/glx/glxext.c index 93391e9fd..6bc7bef8e 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -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) -- cgit v1.2.3