diff options
author | Dave Airlie <airlied@redhat.com> | 2012-08-03 16:42:44 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-08-07 08:25:35 +1000 |
commit | 64623ef90db649e89345f71871affe7a9606f6ea (patch) | |
tree | 444f36ae28a70af6a67dc473534e180e775cdf44 | |
parent | 1a465fef9bc21142eecca3999f0761a3c0501a09 (diff) |
dri2: free slave pixmap on app exit
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@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | hw/xfree86/dri2/dri2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 63feed51a..d60d8ba6c 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); |