diff options
author | Dave Airlie <[email protected]> | 2009-02-24 12:04:49 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2009-02-24 12:04:49 +1000 |
commit | 2ebf9b95213b3d1e67dad16442cdd0d8571ef0b3 (patch) | |
tree | cf1858f8a4f5cce2c6ab172a6986030954749da1 /src/mesa/drivers/dri/r300/r300_texstate.c | |
parent | c32a28d86eda3d1984f6a571be0db6c6f5c7f5dc (diff) |
r300: fix bo ref/unref, plugs DRI handle leaks
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_texstate.c')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_texstate.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 4f145bdbb4e..ef13fed6b22 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -433,9 +433,15 @@ void r300SetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) _mesa_lock_texture(radeon->glCtx, texObj); if (t->bo) { + radeon_bo_unref(t->bo); t->bo = NULL; } + if (rImage->bo) { + radeon_bo_unref(rImage->bo); + rImage->bo = NULL; + } if (t->mt) { + radeon_miptree_unreference(t->mt); t->mt = NULL; } if (rImage->mt) { @@ -447,7 +453,7 @@ void r300SetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) rb->width, rb->height, 1, 0, rb->cpp); texImage->TexFormat = &_mesa_texformat_rgba8888_rev; rImage->bo = rb->bo; - + radeon_bo_ref(rImage->bo); t->bo = rb->bo; radeon_bo_ref(t->bo); t->tile_bits = 0; |