diff options
author | Dave Airlie <airlied@linux.ie> | 2010-11-07 11:46:37 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2010-11-07 11:46:37 +1000 |
commit | 131ef0737e6061673797b9ec5b3a63f543f61c8d (patch) | |
tree | cef19f8ed1253264b42633c64b5c47fb73f5d75f | |
parent | 6f3ff528d93a310ac8adc6dab7e8499dc696796f (diff) |
more refcount in pictures
-rw-r--r-- | render/picture.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/render/picture.c b/render/picture.c index 04ff75260..eeb89b9d5 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1819,6 +1819,9 @@ PicturePtr DuplicatePicture(DrawablePtr pDraw, PicturePtr pSrc) { PicturePtr pPicture; PrivateRec *devPrivates; + PictureScreenPtr ps = GetPictureScreen(pDraw->pScreen); + int error; + pPicture = dixAllocateObjectWithPrivates(PictureRec, PRIVATE_PICTURE); if (!pPicture) return NULL; @@ -1829,5 +1832,17 @@ PicturePtr DuplicatePicture(DrawablePtr pDraw, PicturePtr pSrc) pPicture->pNext = NULL; pPicture->pDrawable = pDraw; + if (pDraw->type == DRAWABLE_PIXMAP) { + ++((PixmapPtr)pDraw)->refcnt; + pPicture->pNext = 0; + } else { + ErrorF("window picture\n"); + } + + error = (*ps->CreatePicture) (pPicture); + if (error != Success) { + FreePicture (pPicture, (XID) 0); + pPicture = 0; + } return pPicture; } |