[PATCH xserver 4/5] randr: properly cleanup on crtc and output destroy

Adam Jackson ajax at nwnk.net
Mon Nov 6 21:54:04 UTC 2017


On Sat, 2017-11-04 at 23:06 +0100, Giuseppe Bilotta wrote:
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
> ---
>  randr/rrcrtc.c   | 6 ++++++
>  randr/rroutput.c | 5 +++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
> index 2eb9fbdc8..90922484f 100644
> --- a/randr/rrcrtc.c
> +++ b/randr/rrcrtc.c
> @@ -873,6 +873,11 @@ RRCrtcDestroyResource(void *value, XID pid)
>              }
>          }
>  
> +        if (pScrPriv->numCrtcs == 0) {
> +            free(pScrPriv->crtcs);
> +            pScrPriv->crtcs = NULL;
> +        }
> +
>          RRResourcesChanged(pScreen);
>      }
>  

Nack. Cleaning up the screen private belongs in CloseScreen or similar,
it shouldn't be triggered from a resource destructor.

- ajax


More information about the xorg-devel mailing list