From: Dave Airlie <airl...@redhat.com>

When the drawable disappears we need to free the prime master/slave combos.

This fixes a leak after a prime app is run.

Signed-off-by: Dave Airlie <airl...@redhat.com>
---
 hw/xfree86/dri2/dri2.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 63feed5..d60d8ba 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -409,6 +409,11 @@ DRI2DrawableGone(pointer p, XID id)
         dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, NULL);
     }
 
+    if (pPriv->prime_slave_pixmap) {
+        
(*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap);
+        
(*pPriv->prime_slave_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap);
+    }
+
     if (pPriv->buffers != NULL) {
         for (i = 0; i < pPriv->bufferCount; i++)
             destroy_buffer(pDraw, pPriv->buffers[i], pPriv->prime_id);
-- 
1.7.11.2

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to