[PATCH 06/12] Xi: add FreeInputMask function

Chase Douglas chase.douglas at canonical.com
Mon Nov 7 18:03:30 PST 2011


On 11/07/2011 01:39 PM, Peter Hutterer wrote:
> Does what it says on the box, compliments MakeInputMask.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  Xi/exevents.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/Xi/exevents.c b/Xi/exevents.c
> index 7f8e6db..6c19ab3 100644
> --- a/Xi/exevents.c
> +++ b/Xi/exevents.c
> @@ -1678,6 +1678,12 @@ MakeInputMasks(WindowPtr pWin)
>      return TRUE;
>  }
>  
> +static void
> +FreeInputMask(OtherInputMasks *imask)
> +{
> +    free(imask);
> +}
> +

FreeInputClient (from patch 05/12) takes a double pointer the object to
be freed, and sets the first pointer to NULL. If that's the paradigm we
want to use internally, shouldn't we do the same here?

>  void
>  RecalculateDeviceDeliverableEvents(WindowPtr pWin)
>  {
> @@ -1738,7 +1744,7 @@ InputClientGone(WindowPtr pWin, XID id)
>  	    } else if (!(other->next)) {
>  		if (ShouldFreeInputMasks(pWin, TRUE)) {
>  		    wOtherInputMasks(pWin)->inputClients = other->next;
> -		    free(wOtherInputMasks(pWin));
> +		    FreeInputMask(wOtherInputMasks(pWin));
>  		    pWin->optional->inputMasks = (OtherInputMasks *) NULL;
>  		    CheckWindowOptionalNeed(pWin);
>  		    FreeInputClient(&other);



More information about the xorg-devel mailing list