FYI, latest fix is from Michel (see below), hopefully it will be pushed soon.
diff --git a/glx/glxext.c b/glx/glxext.c index c882372..e74d00e 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -119,17 +119,25 @@ static int ContextGone(__GLXcontext* cx, XID id) static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) { ScreenPtr pScreen = glxPriv->pDraw->pScreen; + PixmapPtr pPixmap = NULL; + int refcount;
switch (glxPriv->type) { case GLX_DRAWABLE_PIXMAP: case GLX_DRAWABLE_PBUFFER: - (*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw); + pPixmap = (PixmapPtr) glxPriv->pDraw; break; }
- glxPriv->pDraw = NULL; - glxPriv->drawId = 0; + refcount = glxPriv->refCount; __glXUnrefDrawable(glxPriv); + if (refcount > 1) { + glxPriv->pDraw = NULL; + glxPriv->drawId = 0; + } + + if (pPixmap) + (*pScreen->DestroyPixmap)(pPixmap);
return True; }
FYI, latest fix is from Michel (see below), hopefully it will be pushed soon.
diff --git a/glx/glxext.c b/glx/glxext.c __GLXcontext* cx, XID id) __GLXdrawable *glxPriv, XID xid) >pDraw- >pScreen;
index c882372..e74d00e 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -119,17 +119,25 @@ static int ContextGone(
static Bool DrawableGone(
{
ScreenPtr pScreen = glxPriv-
+ PixmapPtr pPixmap = NULL;
+ int refcount;
switch (glxPriv->type) { PIXMAP: PBUFFER: >DestroyPixmap) ((PixmapPtr) glxPriv->pDraw);
case GLX_DRAWABLE_
case GLX_DRAWABLE_
- (*pScreen-
+ pPixmap = (PixmapPtr) glxPriv->pDraw;
break;
}
- glxPriv->pDraw = NULL; glXUnrefDrawabl e(glxPriv) ; >DestroyPixmap) (pPixmap) ;
- glxPriv->drawId = 0;
+ refcount = glxPriv->refCount;
__
+ if (refcount > 1) {
+ glxPriv->pDraw = NULL;
+ glxPriv->drawId = 0;
+ }
+
+ if (pPixmap)
+ (*pScreen-
return True;
}