Fix intel texture image buffer leak.

This commit is contained in:
Thomas Hellström 2006-09-22 10:55:05 +00:00
parent b249ff8a86
commit 5db0e131ef
2 changed files with 3 additions and 3 deletions

View file

@ -74,7 +74,7 @@ intel_miptree_create(struct intel_context *intel,
mt->depth0 = depth0;
mt->cpp = compressed ? 2 : cpp;
mt->compressed = compressed;
mt->refcount = 1;
mt->refcount = 0; /*Allow for unused miptrees */
switch (intel->intelScreen->deviceID) {
case PCI_CHIP_I945_G:
@ -122,7 +122,7 @@ intel_miptree_release(struct intel_context *intel,
return;
DBG("%s %d\n", __FUNCTION__, (*mt)->refcount - 1);
if (--(*mt)->refcount == 0) {
if (--(*mt)->refcount <= 0) {
GLuint i;
intel_region_release(intel, &((*mt)->region));

View file

@ -658,7 +658,7 @@ _mesa_free_texture_image_data(GLcontext *ctx,
void
_mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *texImage )
{
if (texImage->Data) {
if (texImage->Data || ctx->Driver.FreeTexImageData) {
ctx->Driver.FreeTexImageData( ctx, texImage );
}
ASSERT(texImage->Data == NULL);