summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-24 02:13:31 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-24 02:13:41 +0900
commit4f93a3a680560940630c44be0066b72a86ff008a (patch)
tree75edbd5d12d0667b9f9f0df54898b74c514791ff /src
parenta75a3df851339c782e045e01c2b21ffadb1e09f5 (diff)
gallium: Fix texture refcount leak.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 0523cb1949..d246dff433 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -104,6 +104,8 @@ out:
static void cso_release_all( struct cso_context *ctx )
{
+ unsigned i;
+
if (ctx->pipe) {
ctx->pipe->bind_blend_state( ctx->pipe, NULL );
ctx->pipe->bind_rasterizer_state( ctx->pipe, NULL );
@@ -113,6 +115,11 @@ static void cso_release_all( struct cso_context *ctx )
ctx->pipe->bind_vs_state( ctx->pipe, NULL );
}
+ for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
+ pipe_texture_reference(&ctx->textures[i], NULL);
+ for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
+ pipe_texture_reference(&ctx->textures_saved[i], NULL);
+
if (ctx->cache) {
cso_cache_delete( ctx->cache );
ctx->cache = NULL;