Also release direct rendering resources in glXDestroyGLXPixmap.
authorMichel Dänzer <daenzer@vmware.com>
Fri, 19 Jun 2009 09:19:07 +0000 (11:19 +0200)
committerMichel Dänzer <daenzer@vmware.com>
Fri, 19 Jun 2009 16:00:49 +0000 (18:00 +0200)
Fixes leak running compiz with direct rendering.

src/glx/x11/glxcmds.c

index ec3e69e4fe145734f971ae843f81be8973e9f65e..77471b8599c98b7f578106d65f85cf207d5136d7 100644 (file)
@@ -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)