From: Pauli Nieminen <[email protected]>

glx should cleanup DRI2Drawable when GLXDrawable is destroyed.

Signed-off-by: Pauli Nieminen <[email protected]>
---
 glx/glxdri2.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 027615a..79d7f55 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -89,6 +89,8 @@ struct __GLXDRIdrawable {
     __DRIdrawable      *driDrawable;
     __GLXDRIscreen     *screen;
     DRI2DrawablePtr     pDRI2Draw;
+    XID                 id;
+    ClientPtr           client;
 
     /* Dimensions as last reported by DRI2GetBuffers. */
     int width;
@@ -102,6 +104,8 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
 {
     __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
     const __DRIcoreExtension *core = private->screen->core;
+
+    DRI2DestroyDrawable(private->client, private->pDRI2Draw, private->id);
     
     (*core->destroyDrawable)(private->driDrawable);
 
@@ -479,6 +483,8 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
     }
 
     private->pDRI2Draw = DRI2GetDrawable(pDraw);
+    private->id        = drawId;
+    private->client    = client;
 
     private->driDrawable =
        (*driScreen->dri2->createNewDrawable)(driScreen->driScreen,
-- 
1.7.0.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to