aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-17 11:52:48 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-17 11:52:48 +0000
commitbf3ef28f3bd86f2de488f03f1cd08b6e6203d479 (patch)
tree50cbf21e3aba18abc623a8e6f6ce85e6843b5683
parent433ce5e6869d5937e31ff5f305be54092b37f2e4 (diff)
Fixed memory leak in deferred_canvas_record bench
-rw-r--r--bench/DeferredCanvasBench.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/bench/DeferredCanvasBench.cpp b/bench/DeferredCanvasBench.cpp
index 15902b9f58..a1a3901632 100644
--- a/bench/DeferredCanvasBench.cpp
+++ b/bench/DeferredCanvasBench.cpp
@@ -26,8 +26,12 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) {
- SkDeferredCanvas deferredCanvas(canvas->getDevice()->createCompatibleDevice(
- SkBitmap::kARGB_8888_Config, CANVAS_WIDTH, CANVAS_HEIGHT, false));
+ SkDevice *device = canvas->getDevice()->createCompatibleDevice(
+ SkBitmap::kARGB_8888_Config, CANVAS_WIDTH, CANVAS_HEIGHT, false);
+
+ SkDeferredCanvas deferredCanvas(device);
+
+ device->unref();
initDeferredCanvas(deferredCanvas);