[Mesa-dev] [PATCH 2/2] mesa: unreference current winsys buffers when unbinding winsys buffers

Brian Paul brianp at vmware.com
Mon May 20 13:39:49 UTC 2019


Both look OK to me.  Do they need to be tagged with "Cc: 
mesa-stable at lists.freedesktop.org" for the stable branches?

Reviewed-by: Brian Paul <brianp at vmware.com>


On 05/18/2019 07:46 PM, Charmaine Lee wrote:
> This fixes surface leak when no winsys buffers are bound.
> ---
>   src/mesa/main/context.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index 34da16b..04ef4d5 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -1765,6 +1765,10 @@ _mesa_make_current( struct gl_context *newCtx,
>   
>            check_init_viewport(newCtx, drawBuffer->Width, drawBuffer->Height);
>         }
> +      else {
> +         _mesa_reference_framebuffer(&newCtx->WinSysDrawBuffer, NULL);
> +         _mesa_reference_framebuffer(&newCtx->WinSysReadBuffer, NULL);
> +      }
>   
>         if (newCtx->FirstTimeCurrent) {
>            handle_first_current(newCtx);
> 



More information about the mesa-dev mailing list