intel_miptree_release(&irb->mt);
- free(irb);
+ _mesa_delete_renderbuffer(rb);
}
/**
struct nouveau_surface *s = &to_nouveau_renderbuffer(rb)->surface;
nouveau_surface_ref(NULL, s);
- FREE(rb);
+ _mesa_delete_renderbuffer(rb);
}
static struct gl_renderbuffer *
if (rrb && rrb->bo) {
radeon_bo_unref(rrb->bo);
}
- free(rrb);
+ _mesa_delete_renderbuffer(rb);
}
#if defined(RADEON_R100)
TRACE;
free(xrb->Base.Buffer);
- free(xrb);
+ _mesa_delete_renderbuffer(rb);
}
/* see bytes_per_line in libGL */
/**
* Delete a gl_framebuffer.
* This is the default function for renderbuffer->Delete().
+ * Drivers which subclass gl_renderbuffer should probably implement their
+ * own delete function. But the driver might also call this function to
+ * free the object in the end.
*/
void
_mesa_delete_renderbuffer(struct gl_renderbuffer *rb)
{
- /* no-op */
+ _glthread_DESTROY_MUTEX(rb->Mutex);
+ free(rb);
}
pipe_surface_reference(&strb->surface, NULL);
pipe_resource_reference(&strb->texture, NULL);
free(strb->data);
- free(strb);
+ _mesa_delete_renderbuffer(rb);
}
free(srb->Buffer);
srb->Buffer = NULL;
}
- free(srb);
+ _mesa_delete_renderbuffer(rb);
}