i915g: don't destroy a texture buffer if it's NULL.
authorStéphane Marchesin <marcheu@chromium.org>
Wed, 1 Jun 2011 22:32:39 +0000 (15:32 -0700)
committerStéphane Marchesin <marcheu@chromium.org>
Mon, 6 Jun 2011 19:35:58 +0000 (12:35 -0700)
src/gallium/drivers/i915/i915_resource_texture.c

index e05b059..b74b19d 100644 (file)
@@ -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])