diff --git a/src/gallium/drivers/crocus/crocus_context.c b/src/gallium/drivers/crocus/crocus_context.c index 56e4810e6a60..5ba3049b29ec 100644 --- a/src/gallium/drivers/crocus/crocus_context.c +++ b/src/gallium/drivers/crocus/crocus_context.c @@ -194,6 +194,12 @@ crocus_destroy_context(struct pipe_context *ctx) if (ice->blitter) util_blitter_destroy(ice->blitter); screen->vtbl.destroy_state(ice); + + for (unsigned i = 0; i < ARRAY_SIZE(ice->shaders.scratch_bos); i++) { + for (unsigned j = 0; j < ARRAY_SIZE(ice->shaders.scratch_bos[i]); j++) + crocus_bo_unreference(ice->shaders.scratch_bos[i][j]); + } + crocus_destroy_program_cache(ice); u_upload_destroy(ice->query_buffer_uploader);