diff options
Diffstat (limited to 'src/mesa/drivers/dri/common/dri_util.c')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index f5e7923835..befe1675a0 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -485,8 +485,8 @@ dri2CreateNewDrawable(__DRIscreen *screen, if (!pdraw) return NULL; - pdraw->pClipRects = _mesa_malloc(sizeof *pdraw->pBackClipRects); - pdraw->pBackClipRects = _mesa_malloc(sizeof *pdraw->pBackClipRects); + pdraw->pClipRects = &pdraw->dri2.clipRect; + pdraw->pBackClipRects = &pdraw->dri2.clipRect; return pdraw; } @@ -507,11 +507,11 @@ static void dri_put_drawable(__DRIdrawable *pdp) psp = pdp->driScreenPriv; (*psp->DriverAPI.DestroyBuffer)(pdp); - if (pdp->pClipRects) { + if (pdp->pClipRects && pdp->pClipRects != &pdp->dri2.clipRect) { _mesa_free(pdp->pClipRects); pdp->pClipRects = NULL; } - if (pdp->pBackClipRects) { + if (pdp->pBackClipRects && pdp->pClipRects != &pdp->dri2.clipRect) { _mesa_free(pdp->pBackClipRects); pdp->pBackClipRects = NULL; } |