[PATCH] midispcur: Add comment explaining why pRootPicture must not be freed.

Peter Hutterer peter.hutterer at who-t.net
Thu May 27 15:16:59 PDT 2010


On Thu, May 27, 2010 at 12:06:28PM -0700, Jamey Sharp wrote:
> Signed-off-by: Jamey Sharp <jamey at minilop.net>
> Cc: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> On Thu, May 27, 2010 at 1:38 AM, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> > this comment seems a bit odd. is this part of another patch?
> 
> Yeah, it should have been. This patch only makes sense after deleting
> the MoveCursor code though; otherwise, it ought to explicitly free
> pTempPicture as well, except that we know that can't be anything but
> NULL.
> 
>  mi/midispcur.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/mi/midispcur.c b/mi/midispcur.c
> index 59923c8..c279010 100644
> --- a/mi/midispcur.c
> +++ b/mi/midispcur.c
> @@ -569,6 +569,12 @@ miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
>                  if (pBuffer->pSaveGC) FreeGC(pBuffer->pSaveGC, (GContext) 0);
>                  if (pBuffer->pRestoreGC) FreeGC(pBuffer->pRestoreGC, (GContext) 0);
>  
> +#ifdef ARGB_CURSOR
> +                /* If a pRootPicture was allocated for a root window, it
> +                 * is freed when that root window is destroyed, so don't
> +                 * free it again here. */
> +#endif
> +
>                  if (pBuffer->pSave) (*pScreen->DestroyPixmap)(pBuffer->pSave);
>  
>                  free(pBuffer);
> -- 
> 1.7.0

Acked-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
  Peter


More information about the xorg-devel mailing list