gallium: release textures during context tear-down (fix mem leak)
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 16 May 2008 22:04:30 +0000 (16:04 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 16 May 2008 22:04:30 +0000 (16:04 -0600)
src/mesa/state_tracker/st_context.c

index 8db55a179f8217ca939bc938b93e39163dcfdbb3..fb397ea510d5f18d8588235fc0cc35790c6de52c 100644 (file)
@@ -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);