From: Charmaine Lee Date: Sun, 19 May 2019 01:34:06 +0000 (-0700) Subject: mesa: unreference current winsys buffers when unbinding winsys buffers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=12bf7cfecf52083c484602f971738475edfe497e;p=mesa.git mesa: unreference current winsys buffers when unbinding winsys buffers This fixes surface leak when no winsys buffers are bound. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Brian Paul --- diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 34da16b88f4..04ef4d500d8 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);