summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-12-27 19:18:12 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-01 10:21:21 -0700
commit6656864135411d379c06e071c5a5e73b4e4baea5 (patch)
tree76aa3738070a8e236ce9109a3190013db364c6ea
parent6883e02a5cab528623e11ad7717f1052ab2e031d (diff)
fix leak, fix refcount error
-rw-r--r--src/mesa/pipe/softpipe/sp_tile_cache.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.c b/src/mesa/pipe/softpipe/sp_tile_cache.c
index ba1f71b01e..1dbcc5aadd 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.c
+++ b/src/mesa/pipe/softpipe/sp_tile_cache.c
@@ -126,9 +126,17 @@ void
sp_destroy_tile_cache(struct softpipe_tile_cache *tc)
{
uint pos;
+
for (pos = 0; pos < NUM_ENTRIES; pos++) {
- assert(tc->entries[pos].x < 0);
+ //assert(tc->entries[pos].x < 0);
+ }
+ if (tc->surface) {
+ pipe_surface_reference(&tc->surface, NULL);
+ }
+ if (tc->tex_surf) {
+ pipe_surface_reference(&tc->tex_surf, NULL);
}
+
FREE( tc );
}
@@ -466,15 +474,12 @@ sp_get_cached_tile_tex(struct pipe_context *pipe,
tc->tex_level != level ||
tc->tex_z != z) {
/* get new surface (view into texture) */
- struct pipe_surface *ps;
if (tc->tex_surf && tc->tex_surf->map)
pipe_surface_unmap(tc->tex_surf);
- ps = pipe->get_tex_surface(pipe, tc->texture, face, level, z);
- pipe_surface_reference(&tc->tex_surf, ps);
-
- pipe_surface_map(ps);
+ tc->tex_surf = pipe->get_tex_surface(pipe, tc->texture, face, level, z);
+ pipe_surface_map(tc->tex_surf);
tc->tex_face = face;
tc->tex_level = level;