[PATCH libXext] Destroy generic event extension after last display is removed

Peter Hutterer peter.hutterer at who-t.net
Sun Apr 22 22:01:21 PDT 2012


On Fri, Apr 20, 2012 at 03:08:08PM -0700, Chase Douglas wrote:
> The extension record is currently leaked and never freed.
> 
> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>

   e9c1e34..ed8d50b  master -> master

Cheers,
  Peter

> ---
>  src/Xge.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/src/Xge.c b/src/Xge.c
> index 74e4802..1f37e59 100644
> --- a/src/Xge.c
> +++ b/src/Xge.c
> @@ -218,7 +218,15 @@ _xgeDpyClose(Display* dpy, XExtCodes* codes)
>          XFree(xge_data);
>      }
>  
> -    return XextRemoveDisplay(xge_info, dpy);
> +    if(!XextRemoveDisplay(xge_info, dpy))
> +        return 0;
> +
> +    if (xge_info->ndisplays == 0) {
> +        XextDestroyExtension(xge_info);
> +        xge_info = NULL;
> +    }
> +
> +    return 1;
>  }
>  
>  /*
> -- 
> 1.7.9.1
> 


More information about the xorg-devel mailing list