summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharmaine Lee <charmainel@vmware.com>2019-05-18 18:34:06 -0700
committerJuan A. Suarez Romero <jasuarez@igalia.com>2019-05-21 09:02:06 +0000
commit2153c3ae8e96a86b6aa437dece56231ea55b6ba5 (patch)
treea7865f75ff893485b270459c192cbd085189b31b
parent04e9d7bf8f3d578d3535de065cef745ddb319150 (diff)
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 <brianp@vmware.com> (cherry picked from commit 12bf7cfecf52083c484602f971738475edfe497e)
-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 2c3d9a11ce3..dfd1c77d88a 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1767,6 +1767,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);