From 9dfce365c7f35ddea6d81b7f595ddcd6d35382a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Fri, 19 Jun 2009 11:19:07 +0200 Subject: [PATCH] Also release direct rendering resources in glXDestroyGLXPixmap. Fixes leak running compiz with direct rendering. --- src/glx/x11/glxcmds.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index ec3e69e4fe1..77471b8599c 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -869,6 +869,20 @@ PUBLIC void glXDestroyGLXPixmap(Display *dpy, GLXPixmap glxpixmap) req->glxpixmap = glxpixmap; UnlockDisplay(dpy); SyncHandle(); + +#ifdef GLX_DIRECT_RENDERING + { + int screen; + __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, glxpixmap, &screen); + __GLXscreenConfigs *psc = &priv->screenConfigs[screen]; + + if (pdraw != NULL) { + (*pdraw->destroyDrawable) (pdraw); + __glxHashDelete(psc->drawHash, glxpixmap); + } + } +#endif } PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable) -- 2.30.2