summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-07-03 10:12:00 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-07-03 10:12:37 -0600
commit2212c214f1890091c102d4cb3c69ec2df2132322 (patch)
tree4d5f29cade8cf7862c63571a4598b34e45a43ef7 /src
parentade03755bcaec2dedb5cd4d13160ba366ee804cd (diff)
gallium: fix surface memleak in bitmap code
Found w/ tunnel2.c demo.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_bitmap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index f3bc3b8584..de86832342 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -541,6 +541,9 @@ reset_cache(struct st_context *st)
cache->ymin = 1000000;
cache->ymax = -1000000;
+ if (cache->surf)
+ screen->tex_surface_release(screen, &cache->surf);
+
assert(!cache->texture);
/* allocate a new texture */
@@ -588,6 +591,8 @@ st_flush_bitmap_cache(struct st_context *st)
* So unmap and release the texture surface before drawing.
*/
screen->surface_unmap(screen, cache->surf);
+ cache->buffer = NULL;
+
screen->tex_surface_release(screen, &cache->surf);
draw_bitmap_quad(st->ctx,