summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-07-21 15:28:50 -0400
committerKristian Høgsberg <krh@redhat.com>2008-07-21 15:32:12 -0400
commitd5ae85b5b722821499d5796cf0973ecb6ec125f1 (patch)
treefbf10ab7ddb348ee76d48136629361f1adbc91d6 /glx
parentc74ddc87c995c73109827717a49f14846c7c4024 (diff)
Fix embarrasing GLXPixmap leak.
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c4
-rw-r--r--glx/glxext.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 0ca0598fe..083113584 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1226,10 +1226,6 @@ static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type)
}
}
- if (type == GLX_DRAWABLE_PIXMAP) {
- ((PixmapPtr) pGlxDraw->pDraw)->refcnt--;
- }
-
FreeResource(glxdrawable, FALSE);
return Success;
diff --git a/glx/glxext.c b/glx/glxext.c
index 85d8debd4..cd92f6d0a 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -107,6 +107,11 @@ static int ContextGone(__GLXcontext* cx, XID id)
*/
static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
{
+ ScreenPtr pScreen = glxPriv->pDraw->pScreen;
+
+ if (glxPriv->type == GLX_DRAWABLE_PIXMAP)
+ (*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw);
+
glxPriv->pDraw = NULL;
glxPriv->drawId = 0;
__glXUnrefDrawable(glxPriv);