[PATCH 2/3] dri2: free slave pixmap on app exit
Dave Airlie
airlied at gmail.com
Thu Aug 2 23:44:43 PDT 2012
From: Dave Airlie <airlied at 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 <airlied at 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
More information about the xorg-devel
mailing list