From: Marek Olšák Date: Mon, 21 Jan 2019 17:09:07 +0000 (-0500) Subject: st/mesa: purge framebuffers when unbinding a context X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c89e8470e58066637c4bfd5c76a2247eb3608b8b;p=mesa.git st/mesa: purge framebuffers when unbinding a context This fixes pipe_surface "leaks". Cc: 18.3 Acked-by: Timothy Arceri --- 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;