aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorCharmaine Lee <[email protected]>2019-05-18 18:34:06 -0700
committerCharmaine Lee <[email protected]>2019-05-20 13:09:32 -0700
commit12bf7cfecf52083c484602f971738475edfe497e (patch)
tree608cd4ee922a199871b19856641ffa5a91fe9577 /src/mesa/main/context.c
parentb480adfa5ee224528eaed7e1da934a2d3e2b94d6 (diff)
mesa: unreference current winsys buffers when unbinding winsys buffers
This fixes surface leak when no winsys buffers are bound. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c4
1 files changed, 4 insertions, 0 deletions
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);