[PATCH 3/3] dri2: fix master pixmap free and reset pointer

Dave Airlie airlied at gmail.com
Thu Aug 2 23:44:44 PDT 2012


From: Dave Airlie <airlied at redhat.com>

These are two minor changes, one to reset the pointer to NULL,
after freeing the pixmaps, one to make sure we use the right API for
the master pixmap, though I doubt it'll ever really matter.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 hw/xfree86/dri2/dri2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index d60d8ba..23f589c 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -816,8 +816,9 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
         if (pPriv->prime_slave_pixmap->master_pixmap == mpix)
             return &pPriv->prime_slave_pixmap->drawable;
         else {
-            (*master->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap);
+            (*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap);
             (*slave->DestroyPixmap)(pPriv->prime_slave_pixmap);
+            pPriv->prime_slave_pixmap = NULL;
         }
     }
 
-- 
1.7.11.2



More information about the xorg-devel mailing list