[PATCH 3/4] glamor: Make glamor_destroy_textured_pixmap idempotent

Keith Packard keithp at keithp.com
Thu Dec 11 11:23:28 PST 2014


Michel Dänzer <michel at daenzer.net> writes:

> From: Michel Dänzer <michel.daenzer at amd.com>
>
> For robustness against drivers which may call both
> glamor_(egl_)destroy_textured_pixmap and glamor_destroy_pixmap.
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>  glamor/glamor.c     | 1 +
>  glamor/glamor_fbo.c | 2 --
>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/glamor/glamor.c b/glamor/glamor.c
> index cbd0e02..d1aa1cf 100644
> --- a/glamor/glamor.c
> +++ b/glamor/glamor.c
> @@ -226,6 +226,7 @@ glamor_destroy_textured_pixmap(PixmapPtr pixmap)
>              glamor_egl_destroy_pixmap_image(pixmap);
>  #endif
>              glamor_pixmap_destroy_fbo(pixmap_priv);
> +            glamor_set_pixmap_private(pixmap, NULL);
>          }
>      }
>  }
> diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
> index 4273826..d2aabb2 100644
> --- a/glamor/glamor_fbo.c
> +++ b/glamor/glamor_fbo.c
> @@ -540,8 +540,6 @@ glamor_pixmap_destroy_fbo(glamor_pixmap_private *priv)
>          if (fbo)
>              glamor_destroy_fbo(fbo);
>      }
> -
> -    free(priv);

With this patch, 1/4 is no longer necessary, I think, as
glamor_pixmap_destroy_fbo no longer frees the pixmap private?

It doesn't actually matter, I just wondered if I was following things
here.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20141211/eb3aa25a/attachment.sig>


More information about the xorg-devel mailing list