From: Brian Paul Date: Fri, 16 May 2008 22:04:30 +0000 (-0600) Subject: gallium: release textures during context tear-down (fix mem leak) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87afc9bcad9a440352c6c3bda234cf089ff7e265;p=mesa.git gallium: release textures during context tear-down (fix mem leak) --- diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 8db55a179f8..fb397ea510d 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -171,6 +171,10 @@ static void st_destroy_context_priv( struct st_context *st ) _vbo_DestroyContext(st->ctx); + for (i = 0; i < Elements(st->state.sampler_texture); i++) { + pipe_texture_reference(&st->state.sampler_texture[i], NULL); + } + for (i = 0; i < Elements(st->state.constants); i++) { if (st->state.constants[i].buffer) { pipe_reference_buffer(st->pipe, &st->state.constants[i].buffer, NULL);