summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-16 16:04:30 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-16 16:04:30 -0600
commit87afc9bcad9a440352c6c3bda234cf089ff7e265 (patch)
treee5f8dae4112762d198fd89819b9ac28ba57d3a49 /src/mesa/state_tracker
parentf8dce51083042b4d3fabf48524835290b6725682 (diff)
gallium: release textures during context tear-down (fix mem leak)
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 8db55a179f..fb397ea510 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);