diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2013-03-22 10:51:05 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2013-05-23 18:16:44 +0200 |
commit | ab6e85d1f5dd4657591b314b85fd2453f99c3712 (patch) | |
tree | 17f7708f2d2f3531528f05d676202ecaea35abab | |
parent | 0a84f2760eccf07781ae6c3f55d2d246c155c9ce (diff) |
glamor: Keep old private in radeon_pixmap_set_bo
-rw-r--r-- | src/radeon.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/radeon.h b/src/radeon.h index 1cbeef67..8dc3d124 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -563,16 +563,20 @@ static inline void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo) if (priv->bo) radeon_bo_unref(priv->bo); - free(priv); - priv = NULL; + if (!bo) { + free(priv); + priv = NULL; + } } if (bo) { uint32_t pitch; - priv = calloc(1, sizeof (struct radeon_pixmap)); - if (priv == NULL) - goto out; + if (!priv) { + priv = calloc(1, sizeof (struct radeon_pixmap)); + if (!priv) + goto out; + } radeon_bo_ref(bo); priv->bo = bo; |