diff options
author | Eric Anholt <eric@anholt.net> | 2008-01-18 11:39:35 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-01-18 11:39:35 -0800 |
commit | 02d5ba849197e19843dad164239b51f18fb16faf (patch) | |
tree | 986209ba8e3ef51cc52b176182315408c171ebd4 /src/mesa/drivers | |
parent | 2afe5344dfb7b19563046d7b2f522d91335aac66 (diff) |
[intel] Fix memory leak with fake bufmgr.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_bufmgr_fake.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c index ae7154daa2..a6598c1a96 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c +++ b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c @@ -631,6 +631,7 @@ dri_fake_bo_unreference(dri_bo *bo) { dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; dri_bo_fake *bo_fake = (dri_bo_fake *)bo; + int i; if (!bo) return; @@ -641,7 +642,11 @@ dri_fake_bo_unreference(dri_bo *bo) if (bo_fake->block) free_block(bufmgr_fake, bo_fake->block); free_backing_store(bo); + + for (i = 0; i < bo_fake->nr_relocs; i++) + dri_bo_unreference(bo_fake->relocs[i].target_buf); free(bo_fake->relocs); + free(bo); DBG("drm_bo_unreference: free %s\n", bo_fake->name); return; @@ -942,7 +947,7 @@ dri_fake_calculate_validate_flags(dri_bo *bo) /* Do the same for the tree of buffers we depend on */ dri_fake_calculate_validate_flags(r->target_buf); - if (target_fake->flags == 0) { + if (target_fake->validate_flags == 0) { target_fake->validate_flags = r->validate_flags; } else { /* Mask the memory location to the intersection of all the memory |