mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
Fix intel texture image buffer leak.
This commit is contained in:
parent
b249ff8a86
commit
5db0e131ef
2 changed files with 3 additions and 3 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue