[Mesa-dev] [PATCH] i965: Fix leak in blorp CopyTexSubImage2D

christopher.halse.rogers at canonical.com christopher.halse.rogers at canonical.com
Fri Feb 15 21:39:07 PST 2013


From: Christopher James Halse Rogers <raof at ubuntu.com>

_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
---
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 3615b09..d1ab7cb 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -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;
 }
 
-- 
1.8.1.2



More information about the mesa-dev mailing list