i965: Fix leak in blorp CopyTexSubImage2D
authorChristopher James Halse Rogers <raof@ubuntu.com>
Sat, 16 Feb 2013 05:39:07 +0000 (16:39 +1100)
committerPaul Berry <stereotype441@gmail.com>
Sat, 16 Feb 2013 16:11:14 +0000 (08:11 -0800)
_mesa_delete_renderbuffer does not call the driver-specific
renderbuffer delete function, so the blorp code was leaking the
Intel-specific bits, including some GEM objects.

Call the renderbuffer's ->Delete() method instead, which does the
right thing.

Fixes Unity rapidly sending the machine into the arms of the OOM-killer

Note: This is a candidate for the 9.1 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp

index fd004891c80ee1265c4009f61c1cf9381d47b9ec..37524ad1a1403d7d6c32e22f575f7ddcce2d39b4 100644 (file)
@@ -337,7 +337,7 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
    GLbitfield buffer_bit = 0;
 
    if (!formats_match(buffer_bit, src_irb, dst_irb)) {
-      _mesa_delete_renderbuffer(ctx, dst_rb);
+      dst_rb->Delete(ctx, dst_rb);
       return false;
    }
 
@@ -387,7 +387,7 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
                     srcX0, srcY0, dstX0, dstY0, dstX1, dstY1, false, mirror_y);
    }
 
-   _mesa_delete_renderbuffer(ctx, dst_rb);
+   dst_rb->Delete(ctx, dst_rb);
    return true;
 }