Mesa (master): i915g: don't destroy a texture buffer if it's NULL.

Stephane Marchesin marcheu at kemper.freedesktop.org
Mon Jun 6 20:07:53 UTC 2011


Module: Mesa
Branch: master
Commit: 3103c08ae91f6bcd42a223a5fe7f9d38746565c4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3103c08ae91f6bcd42a223a5fe7f9d38746565c4

Author: Stéphane Marchesin <marcheu at chromium.org>
Date:   Wed Jun  1 15:32:39 2011 -0700

i915g: don't destroy a texture buffer if it's NULL.

---

 src/gallium/drivers/i915/i915_resource_texture.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c
index e05b059..b74b19d 100644
--- a/src/gallium/drivers/i915/i915_resource_texture.c
+++ b/src/gallium/drivers/i915/i915_resource_texture.c
@@ -700,7 +700,8 @@ i915_texture_destroy(struct pipe_screen *screen,
    struct i915_winsys *iws = i915_screen(screen)->iws;
    uint i;
 
-   iws->buffer_destroy(iws, tex->buffer);
+   if (tex->buffer)
+      iws->buffer_destroy(iws, tex->buffer);
 
    for (i = 0; i < Elements(tex->image_offset); i++)
       if (tex->image_offset[i])




More information about the mesa-commit mailing list