diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 536b092f068cf..055e56d52b4e0 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -983,17 +983,17 @@ st_destroy_context(struct st_context *st) st_destroy_program_variants(st); - st_context_free_zombie_objects(st); - - simple_mtx_destroy(&st->zombie_sampler_views.mutex); - simple_mtx_destroy(&st->zombie_shaders.mutex); - /* Do not release debug_output yet because it might be in use by other threads. * These threads will be terminated by _mesa_free_context_data and * st_destroy_context_priv. */ _mesa_free_context_data(ctx, false); + st_context_free_zombie_objects(st); + + simple_mtx_destroy(&st->zombie_sampler_views.mutex); + simple_mtx_destroy(&st->zombie_shaders.mutex); + /* This will free the st_context too, so 'st' must not be accessed * afterwards. */ st_destroy_context_priv(st, true);