mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 09:58:05 +02:00
gallium: fix surface memleak in bitmap code
Found w/ tunnel2.c demo.
This commit is contained in:
parent
ade03755bc
commit
2212c214f1
1 changed files with 5 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue