st/mesa: purge framebuffers when unbinding a context
authorMarek Olšák <marek.olsak@amd.com>
Mon, 21 Jan 2019 17:09:07 +0000 (12:09 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 23 Jan 2019 19:32:57 +0000 (14:32 -0500)
This fixes pipe_surface "leaks".

Cc: 18.3 <mesa-stable@lists.freedesktop.org>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/state_tracker/st_manager.c

index 7a3d9777101ce826f6519318b497bab013546d9c..7064b99743cc37268a2f0b5661869e830be3a674 100644 (file)
@@ -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;