diff options
author | Kristian Høgsberg <krh@redhat.com> | 2009-02-13 11:05:54 -0500 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2009-03-13 17:38:39 -0700 |
commit | d6d8663a88aa6b9820fa977cf2efd75e1f433f5f (patch) | |
tree | 22e65222ea5dce77effdcb5b438b8ac8c680f6d6 | |
parent | 13990bd98a97e4f0898a9b3cab2d445c1c456fc7 (diff) |
intel: Fix intelSetTexBuffer miptree leak.
The intelImage also holds a reference to the miptree, so unref that as well.
(cherry picked from commit 5b354d39d466e3a463c6766fe06f737aa6e6b7bd)
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_image.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index c415e09bc5..90894f9524 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -753,16 +753,21 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) _mesa_lock_texture(&intel->ctx, texObj); + texImage = _mesa_get_tex_image(&intel->ctx, texObj, target, level); + intelImage = intel_texture_image(texImage); + + if (intelImage->mt) { + intel_miptree_release(intel, &intelImage->mt); + assert(!texImage->Data); + } if (intelObj->mt) intel_miptree_release(intel, &intelObj->mt); intelObj->mt = mt; - texImage = _mesa_get_tex_image(&intel->ctx, texObj, target, level); _mesa_init_teximage_fields(&intel->ctx, target, texImage, rb->region->width, rb->region->height, 1, 0, internalFormat); - intelImage = intel_texture_image(texImage); intelImage->face = target_to_face(target); intelImage->level = level; texImage->TexFormat = intelChooseTextureFormat(&intel->ctx, internalFormat, |