From c89e8470e58066637c4bfd5c76a2247eb3608b8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 21 Jan 2019 12:09:07 -0500 Subject: [PATCH] st/mesa: purge framebuffers when unbinding a context This fixes pipe_surface "leaks". Cc: 18.3 Acked-by: Timothy Arceri --- src/mesa/state_tracker/st_manager.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 7a3d9777101..7064b99743c 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -1095,7 +1095,12 @@ st_api_make_current(struct st_api *stapi, struct st_context_iface *stctxi, st_framebuffers_purge(st); } else { + GET_CURRENT_CONTEXT(ctx); + ret = _mesa_make_current(NULL, NULL, NULL); + + if (ctx) + st_framebuffers_purge(ctx->st); } return ret; -- 2.30.2