Comment 38 for bug 328232

Revision history for this message
In , Shuang-he (shuang-he) wrote :

Seems pixmaps get refcnt incremented during I830DRI2CreateBuffers, but not dereferencing it corespondingly. Haven't tried this out, hope it would help:

diff --git a/src/i830_dri.c b/src/i830_dri.c
index 6a32492..633895b 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1618,11 +1618,20 @@ I830DRI2DestroyBuffers(DrawablePtr pDraw, DRI2BufferPtr buffers, int count)
 {
     ScreenPtr pScreen = pDraw->pScreen;
     I830DRI2BufferPrivatePtr private;
+ PixmapPtr pDepthPixmap = NULL;
     int i;

     for (i = 0; i < count; i++)
     {
        private = buffers[i].driverPrivate;
+ if (buffers[i].attachment == DRI2BufferFrontLeft ||
+ buffers[i].attachment == DRI2BufferStencil && pDepthPixmap) {
+ private->pPixmap->refcnt--;
+ }
+
+ if (buffers[i].attachment == DRI2BufferDepth)
+ pDepthPixmap = private->pPixmap;
+
        (*pScreen->DestroyPixmap)(private->pPixmap);
     }