From: José Fonseca Date: Wed, 23 Apr 2008 17:13:31 +0000 (+0900) Subject: gallium: Fix texture refcount leak. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f93a3a680560940630c44be0066b72a86ff008a;p=mesa.git gallium: Fix texture refcount leak. --- diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 0523cb19497..d246dff433d 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;